Draw rectangle in the selection, Highcharts

随声附和 提交于 2019-12-13 18:28:42

问题


I want to draw rectangle or square in selection area to show the selected xAxis min, max and yAxis min max in highchart.

Thanks in Advance


回答1:


This is what you need: http://jsfiddle.net/meFgf/




回答2:


Explaining @igor-shastin's example...

  • Set zoomType to "xy"
  • Add a rect to the chart with 0 dimensions and hang onto the reference
  • In the selection event:
    • Grab the event.xAxis[0].min and .max; same for .yAxis
    • Update the rect coordinates so it renders where the selection was made
    • Return false and/or call event.preventDefault() to prevent actually zooming


来源:https://stackoverflow.com/questions/12595575/draw-rectangle-in-the-selection-highcharts

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!