Search code examples
amcharts

How to set orientation for AMCharts Stockchart to vertical


I am playing around with AMCharts StockChart for a projcet I am working on.

I will like to change the orientation for the StockCharts to vertical: i.e. the categoryAxis on the Left, and the Value Axis bottom - so the lines would show vertically instead of horizontal (as it is by default)

Does anybody know how to do this?

Basically, I want to take This Horizontal Chart and turn it into this vertical chart


Solution

  • Stock charts can only be rotated at the panel level. You can set rotate: true directly in each panel or in panelsSettings:

    panelsSettings: {
      rotate: true
    }
    

    You'll need to disable the global scrollbar and use a panel-level chartScrollbar as the global one doesn't get rotated.

    panels: [{
      chartScrollbar: {},
      // ...
    }],
    chartScrollbarSettings: {
      enabled: false
    }
    

    Here's a demo