Multiple value axes on XY / Scatter chart

Martynas Majeris -

It is possible to have multiple value axis on XYChart.

You just need to create additional ValueAxis (use position="right" if you want to place it on the right), then assign some graphs to it:

// Y
var yAxis = new AmCharts.ValueAxis();
yAxis.position = "left";

// Another Y
var yAxis2 = new AmCharts.ValueAxis();
yAxis2.position = "left"; // set this to "right" if you want it on the right
yAxis2.offset = 30;

// graph #1
var graph1 = new AmCharts.AmGraph();
graph1.lineColor = "#FF6600";
graph1.xField = "ax";
graph1.yField = "ay";

// graph #2
var graph2 = new AmCharts.AmGraph();
graph2.lineColor = "#FCD202";
graph2.xField = "bx";
graph2.yField = "by";
graph2.yAxis = yAxis2; // we need to assign at least one graph to a value axis or it's not shown

Have more questions? Submit a request


  • Avatar
    New chao

    very useful, thanks guy.

Powered by Zendesk