Skip to content

TypeError: Cannot read property 'null' of undefined #2604

Description

@haschu

I couldn't reproduce the issue in a plunk, therefore I made a screenshot from the browser console:

bildschirmfoto 2016-05-19 um 22 33 15

This happens for some reasons in one of our projects.

The problem is in scale.time.js:

getPixelForTick: function(index, includeOffset) {
    return this.getPixelForValue(this.tickMoments[index], null, null, includeOffset);
},

null,null is passed to: this.getLabelMoment(datasetIndex, index); here:

getPixelForValue: function(value, index, datasetIndex, includeOffset) {
    var labelMoment = value && value.isValid && value.isValid() ? value : this.getLabelMoment(datasetIndex, index);

and then this.labelMoments[null][null] failed:

getLabelMoment: function(datasetIndex, index) {
    return this.labelMoments[datasetIndex][index];
}

Going to post a pull request for that tomorrow.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions