Skip to content

[ Line Chart ] Line chart does not handle datapoints created with the Number constructor #3124

Description

@MatthieuRivaud

Data points created with the Number constructor (ex: new Number(...)) : typeof (new Number()) yields "object", thus Chart.controllers.line.updateElement and Chart.Scale.getRightValue treat those values as { x: ..., y: ... } objects and skip them (because x and y are undefined).

If I hack those functions to consider ... instanceof Number the same as typeof ... === 'number', the data points are correctly displayed.

Should we try to handle this kind of (edge?) case ? Other chart types do seem to accept Number objects (tested a radar chart).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions