Is there a way to programmatically set the range of an XYScrollBar in Amcharts 4?

时间:2019-04-08 14:04:48

标签: javascript amcharts

I've got multiple graphs on one page and all are using the same values for the x-axis. When the user selects a range using the scroll bar, I want all graphs to sync to that range. The graph they make the range selection on naturally scrolls, but the other graphs remain staionary.

Is there a way to set the range of a scroll bar from code? I looked at the XYScrollbar reference but didn't find anything in the methods section like setRange(...).

1 个答案:

答案 0 :(得分:0)

您应该设置滚动条的开始结束属性:

https://www.amcharts.com/docs/v4/reference/scrollbar/#start_property https://www.amcharts.com/docs/v4/reference/scrollbar/#end_property

已更新:

这实际上只工作一次。为了使它一致地工作,我不得不使用未记录的fixRange(range:IRange)方法。我不确定我为什么不记录它。