javascript - AmCharts - Position ChartScrollbar on Bottom? - Stack Overflow

Is this possible? Legends have this attribute (topbottom), and amStockCharts library has this configur

Is this possible? Legends have this attribute (top/bottom), and amStockCharts library has this configuration option as well. So, for the "regular" amCharts library, is it possible to position the chartScrollbar on the bottom?

I want to avoid any CSS hacks after the chart draws as well.

Is this possible? Legends have this attribute (top/bottom), and amStockCharts library has this configuration option as well. So, for the "regular" amCharts library, is it possible to position the chartScrollbar on the bottom?

I want to avoid any CSS hacks after the chart draws as well.

Share Improve this question edited Oct 25, 2018 at 1:38 Adam asked Jun 10, 2015 at 23:25 AdamAdam 2642 silver badges14 bronze badges 5
  • from the docs the Chart Scrollbar has its default position to be on the bottom.. whats the issue? – John Ruddell Commented Jun 10, 2015 at 23:30
  • I know it's on the StockCharts docs, but seems to be missing for regular charting library. It's a different product / license. Curious if anyone has a workaround for the basic amChart library. – Adam Commented Jun 10, 2015 at 23:35
  • oh gotcha.. well if you really need to change that you could probably just inspect the chart in your browser.. find the scrollbar and do something like position: absolute; bottom: 0 but I wouldn't know without testing – John Ruddell Commented Jun 10, 2015 at 23:42
  • Trying to do so without any CSS after graphs draw. Updated q - thanks anyway. – Adam Commented Jun 10, 2015 at 23:45
  • sure thing... there is no documentation so you may not be able to without css hacks :( – John Ruddell Commented Jun 10, 2015 at 23:46
Add a ment  | 

4 Answers 4

Reset to default 3

In the latest update to AmCharts, this has been added as a config option. You can set "oppositeAxis: false" on chartScrollbar properties to move the scrollbar to the bottom. Hope this can be helpful.

Position of a Scrollbar in our regular JavaScript charts is always opposite the axis. So you have to set categoryAxis.position = "top" in order scrollbar to be at the bottom.

I'm late but I didn't find a better solution elsewhere. You can use

chartScrollbar.oppositeAxis = false;
chartScrollbar.offset = 20;

This will push the scrollbar next to the categoryAxis. Use the offset to move the scrollbar away from the labels.

You can achieve that by changing chart.scrollbarX.parent value like this:

chart.scrollbarX.parent = chart.bottomAxesContainer;

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744307953a4567810.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信