Making rangeSelector and animateZoom both active at the same time in Dygraph

半城伤御伤魂 提交于 2019-12-11 19:32:44

问题


I want to use both animated zoom and range selector in the vertical barchart plotted using Dygraph. Setting both animateZoom and rangeSelector options to true is not working . But any one of these two are working fine individually.Please suggest me the solution. Any help would be greatly appreciated.


回答1:


Those two options don't work very well together, so the combination is disabled. When you have a range selection, you typically zoom the chart by dragging the handles on either end of the selected range. The resulting sequence of mousemove events results in what looks like an animated zoom. Animating the zooms between those events would be superfluous.




回答2:


Seems like there is a workaround. Try this: 1. disable range selector initially 2. have a button in your page that has an event handler that updates the graph options and sets rangeSelector to true 3. click this button on document load. Now both animatedzoom and range selector will work



来源:https://stackoverflow.com/questions/23578107/making-rangeselector-and-animatezoom-both-active-at-the-same-time-in-dygraph

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