Skip to content Skip to sidebar Skip to footer

How Do I Implement The 'autoskip' Feature In Chartjs?

Example I am trying to use the autoSkip feature found here in the chart.js documentation: https://www.chartjs.org/docs/latest/axes/cartesian/?h=autoskip The issue I am having is

Solution 1:

In case anyone is wondering, please update to 2.9. Confirmed that the issue is resolved there.

https://github.com/chartjs/Chart.js/issues/6591

Solution 2:

I noticed your autoskip is in lower case where in the documentation its in camlcase (ie. autoSkip) - from my experience with Chartjs, I've found that it might make a difference to try and fix that and see if that does the trick

Solution 3:

You could try changing

distribution: series

to

distribution: linear

It looks to me like its trying to space the data evenly, despite the fact that you're missing data for 3 days (the weekend maybe?). It really shouldn't break your labels... but I bet the labels know there's enough space for n labels on the graph, but they don't realize that three of the labels are being squished together.

The default distribution is linear, so you could also just remove it. (https://www.chartjs.org/docs/latest/axes/cartesian/time.html#scale-distribution)

Solution 4:

For anyone wondering, a chartjs dev has replied to my post here: https://github.com/chartjs/Chart.js/issues/6591

Looks like there are some issues in the current Chart.js version. Should be fixed in 2.9.

Post a Comment for "How Do I Implement The 'autoskip' Feature In Chartjs?"