3

我搜索了文档,但找不到讨论这个的帖子。

我目前正在开发一个可用于移动和 PC 浏览器的项目。由于 iPhone 上的屏幕非常小,我想禁用它上的 highcharts 交互(即使向下滚动页面,交互也会让我失败)。

我想问一下是否有像“hasInteraction:false”这样的参数。

感谢您提供任何提示!

更新:

我尝试了 Ricardo Lohmann 的这段代码,它正在禁用鼠标跟踪:

plotOptions: {
    series: {
        enableMouseTracking: false
    }
}

但是在移动设备上它仍然阻止我的手指向下滚动。我在 Google 上搜索并找到了一个帖子:http ://blog.rafael.jp/post/2958719820/div-mouseenabled-false但仍然无法正常工作(让图表不会阻止我的手指滚动)

4

3 回答 3

6

我也在寻找解决方案。
更准确地说,即使手指开始在图表上拖动,我也想启用页面滚动。我仍然希望触摸数据点会打开工具提示。

您可能对 v3.0.4 "Added new option, tooltip.followTouchMove ..."中的这个提交感兴趣。我还是要试试。我在 iPhone 模拟器上试过了,它可以工作:

在您的 HTML 页面中的某处:

<script type="text/javascript" src="//code.highcharts.com/3.0.1/highcharts.js"></script>

稍后,当您在 JavaScript 代码中创建图表时:

$('#chartdiv').highcharts({
    chart : {
        type : 'line',  // e.g. for a line chart
        zoomType: null,  // this is already the default, it's just to stress what's said in commit comments and make code "speak"
    },
    tooltip: {
        followPointer: false,  // this is already the default, it's just to stress what's said in commit comments and make code "speak"
        followTouchMove: false,  // this is already the default, it's just to stress what's said in commit comments and make code "speak"
    },
    // other options...
});
于 2013-08-19T09:33:12.800 回答
6
plotOptions: {
    series: {
        enableMouseTracking: false
    }
}

演示

于 2013-01-15T13:53:59.687 回答
-1
       plotOptions: {
           <your type of chart, for example "spline">: {
                enableMouseTracking: false
            }
        },

可以解决你的问题

于 2017-05-18T03:24:53.890 回答