Skip to content

[v2.0-dev] null value in dataset corrupts scale calculation #1373

@fastrde

Description

@fastrde

in file src/scales/scale.linear.js at line 160

return typeof rawValue === "object" ? 
   (this.isHorizontal() ? rawValue.x : rawValue.y) : rawValue;

the test typeof rawValue === "object" is also true for null and an error is thrown because x and y are not properties of null

this line does the trick for me

return (typeof rawValue === "object" && rawValue !== null)  ? 
    (this.isHorizontal() ? rawValue.x : rawValue.y) : rawValue;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions