nagix / chartjs-plugin-streaming

Chart.js plugin for live streaming data
MIT License
546 stars 133 forks source link

Zooming doesn't work with type: "time" #121

Open esther-j opened 4 years ago

esther-j commented 4 years ago

I'm trying to use the Chart.js zooming plugin alongside this plugin, but I want to be able to zoom on a time chart that isn't streaming.

When I try to set zooming settings similar to this example, the chart is able to zoom when plugins.streaming = true and scales.xAxes[0].type = "realtime". However, when the same exact chart has options plugins.streaming = false and scales.xAxes[0].type = "time" (my desired behavior), the zooming doesn't work.

I want to be able to use streaming charts as well as static zooming charts, which is why I need to use both plugins separately, but am having trouble getting this to work.

nagix commented 3 years ago

It seems that chartjs-plugin-zoom 0.x doesn't work well with the 'time' scale, but 1.0.0 fixes it. Try to use chartjs-plugin-zoom 1.0.0 with Chart.js 3.x and chartjs-plugin-streaming 2.x.