Open cassde opened 1 year ago
Panning is if you set the range to show Jan 2-5, and then you want to move that view to earlier and later (continuing to only show the span of 3 days, for example).
It sounds like you want to skip the x-axis dates that don't have data points. That's a general chart.js question. Can't use spanGaps, since that's for line charts.
It sounds like you want something like:
options.scales.x.type = "timeseries" options.scales.x.ticks.source = "data"
The source = "data" removes the x-axis dates with no data points, and type = "timeseries" makes it look better.
I'm adding chartjs-plugin-zoom to my project, I need to pan on x axis but when I add limits (max), pan doesn't work. The whole chart is fixed and doesn't pan left/right My codesandbox: https://codesandbox.io/embed/competent-pine-lgtijw?fontsize=14&hidenavigation=1&theme=dark Screenshot ( as you can see all the data is displayed at once on the chart) My code:
How can I fix the chart so it pans from first ms till last ms ( without displaying all dates at once). If I don't add limits, then x Axis displays dates(ms) that haven't been specified in the data options.