Chartjs-How do I get the current step size of a chartjs chart whose stepSize I have not defined?

1πŸ‘

βœ…

I don’t know if you can get the number of the stepSize directly, but with

chartVariable.scales['y-axis-0'].ticksAsNumbers

you get an array with all ticks. With this you can easily get the stepSize.

Edit: chartVariable is chart in your specific case.

Leave a comment