(对不起我的英文)我使用chartjs-plugin-streaming实时chartjs,我想使用chartjs-plugin-zoom。
但是变焦不起作用。
当我测试缩放时,出现缩放区域,但在图表中离开鼠标时,什么也没有发生
我看到chartjs-plugin-zoom的方法doZoom被调用了,然后我认为问题出在流插件中,但我不知道具体在哪里。
我之前测试过调用pause streaming来进行缩放,但也有同样的问题。
我能做些什么来使变焦工作?
谢谢
发布于 2018-08-21 11:34:08
chartjs-plugin-streaming v1.6.0现在支持chartjs-plugin-zoom。
包括Chart.js、chartjs-plugin-zoom.js、chartjs-plugin-streaming.js和所需的库(Moment.js和Hammer.js),并添加pan和zoom选项。请注意,与其他比例类型不同,rangeMin和rangeMax选项不指定时间值。相反,pan.rangeMin和pan.rangeMax限制delay选项值的范围,而zoom.rangeMin和zoom.rangeMax限制duration选项值的范围。
options: {
// Assume x axis is the realtime scale
pan: {
enabled: true, // Enable panning
mode: 'x', // Allow panning in the x direction
rangeMin: {
x: null // Min value of the delay option
},
rangeMax: {
x: null // Max value of the delay option
}
},
zoom: {
enabled: true, // Enable zooming
mode: 'x', // Allow zooming in the x direction
rangeMin: {
x: null // Min value of the duration option
},
rangeMax: {
x: null // Max value of the duration option
}
}
}https://stackoverflow.com/questions/51772328
复制相似问题