图表JS缩放盘 [英] Chart JS Zoom Pan

查看:116
本文介绍了图表JS缩放盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Chart JS Zoom / Pan插件( https://github.com/ chartjs / chartjs-plugin-zoom ),想知道是否有一种方法可以在没有数据的情况下将其禁用。当前的基本选项设置为

I am using the Chart JS Zoom/Pan Plugin (https://github.com/chartjs/chartjs-plugin-zoom) and was wondering if there is a way to disable it when there is no data present. The current basic options settings are

pan: {
    enabled: true,
    mode: 'x'
},
zoom: {
    enabled: true,
    mode: 'x'
}


推荐答案

是的,您可以通过将 enabled设置为false和/或使用chart.resetZoom()链接

Yes, you can change this by setting "enabled" to false and/or use chart.resetZoom() link

这篇关于图表JS缩放盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆