简体   繁体   English

禁用捏以放大高库存/高图表

[英]Disable pinch to zoom in highstock/highcharts

With the new update for highcharts came support for pinch to zoom on the iPad/iPhone, however this doesn't work how I expected. 在针对highcharts的新更新中,出现了对捏放大iPad / iPhone的支持,但是这并没有达到我的预期。 I presumed that the chart would actually zoom into the date range, instead it just literally zooms into the chart lines and markers, rendering the functionality a bit pointless. 我以为图表实际上会放大到日期范围,而只是从字面上放大到图表线和标记,从而使功能显得毫无意义。

Is it possible to disable this? 是否可以禁用此功能?

There is a chart.zoomType and chart.pinchType property that take the same values (x,y,xy,none). 有一个chart.zoomType和chart.pinchType属性具有相同的值(x,y,xy,无)。 By default chart.pinchType is null and reverts to chart.zoomType. 默认情况下,chart.pinchType为null,并还原为chart.zoomType。 If you want only zooming on the x-axis for pinching, you would do: 如果只想在x轴上缩放以进行捏合,则可以执行以下操作:

chart : {
  pinchType : 'x'
  ...
}

Or set chart.pinchType to 'none' to completely disable. 或将chart.pinchType设置为“ none”以完全禁用。 Or leave it null and set your chart.zoomType to either of these. 或将其保留为空,然后将您的chart.zoomType设置为其中两个。

http://api.highcharts.com/highcharts#chart.pinchType http://api.highcharts.com/highcharts#chart.pinchType

http://api.highcharts.com/highcharts#chart.zoomType http://api.highcharts.com/highcharts#chart.zoomType

Looks like setting pinchType to anything doesn't work. 似乎将pinchType设置为任何值都无效。 Until we set zoomType to null charts are still being zoomed by tough gestures on iOS Safari. 在我们将zoomType设置为null之前,iOS Safari上的手势仍然会放大图表。 Plus, we looked into the source code and the property doesn't seem to be implemented. 另外,我们调查了源代码,该属性似乎未实现。 We have Highcharts JS v.4.1.7. 我们有Highcharts JS v.4.1.7。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM