chartjs / chartjs-plugin-zoom

Zoom and pan plugin for Chart.js
MIT License
579 stars 322 forks source link

LineChart disappears while zooming in if spanGaps: true and non-null datapoints are out of bounds #795

Open ale-coe opened 8 months ago

ale-coe commented 8 months ago

When using a dataset that has spanGaps: true and several null values in its data and the user zooms in, the lineChart disappears. The reason seems to be that the non-null values have no representation on the x-axis anymore. See this codepen.

I would expect that there is some interpolation going on internally that addresses this issue but this isn't the case. I tried modifying the dataset by interpolating "missing" values but there were visible jumps when rendering the line during zoom events which makes it not applicable for my use case.

Is there any workaround for this?