Skip to content

Bug: scaleOverride floating point error #35

@jakobt480

Description

@jakobt480

When incrementing with scaleStepWidth containing floating point numbers there is a rounding error that courses really long label values. This doesn't occur with the standard charts in chart.js, when using the same scaling. Made a hack fix by using Math.round in line 295.

labelsArray[index] = helpers.template(templateString, { value: (graphMin + Math.round((stepValue * (index)) * 100) / 100).toFixed(stepDecimalPlaces) });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions