5

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.

Adam
  • 254
  • 2
  • 13
  • from the [docs](http://docs.amcharts.com/3/javascriptstockchart/ChartScrollbarSettings) the Chart Scrollbar has its default position to be on the bottom.. whats the issue? – John Ruddell Jun 10 '15 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 Jun 10 '15 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 Jun 10 '15 at 23:42
  • Trying to do so without any CSS after graphs draw. Updated q - thanks anyway. – Adam Jun 10 '15 at 23:45
  • sure thing... there is no documentation so you may not be able to without css hacks :( – John Ruddell Jun 10 '15 at 23:46

4 Answers4

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.

Adam
  • 254
  • 2
  • 13
2

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.

zeroin
  • 5,863
  • 6
  • 31
  • 42
  • Thanks. Figured it out in that way, but that's swapping the axis. I actually contacted them and there's no way to draw the scrollbar beneath the category axis when it's on the bottom, but it may make it into a future release. – Adam Jun 11 '15 at 15:08
  • 1
    It's strange that this is the only way. [stock amcharts3](https://docs.amcharts.com/3/javascriptstockchart/ChartScrollbarSettings) has this option as I think is the better way: adding a position: "bottom" to the scrollsettings – pikilon Aug 02 '16 at 09:29
0

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.

Arnaud
  • 39
  • 5
0

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

chart.scrollbarX.parent = chart.bottomAxesContainer;
Arseniy-II
  • 8,323
  • 5
  • 24
  • 49