axisYType: String

Setting axisYType lets you choose between primary and secondary Y Axis for a dataSeries to plot against. By choosing “secondary” Axis you can plot the series against axisY2.
In case of Multi-Series or Combinational Charts, one can assign primary axis to some series and secondary axis to other series.

This is helpful when dataSeries objects use different unit of measurement or range of data. By default, all series are plotted against primary Y axis.


Default: “primary”
Options: “primary”, “secondary”

Note
  • Properties for axisY2 (secondary axis) is same as axisY (primary axis).


var  chart =  new  CanvasJS.Chart("container",
{
 .
 .
 data: [{
   axisYType: "secondary",
  }
 ],
 .
 .
});
chart.render();


Try it Yourself by Editing the Code below.

  Also See:    



In order to provide better support,we have closed the comments and switched completely to our Forums.
If you have any questions, please feel free to ask in our forums.

Comments 7

  1. Hi, How can I set a secondary axis range ? For some reason the automatic setting makes my line flat. the values are between 15 and 25, but the secondary axis ranges from 0 to 50. The primary axis works as expected.

    • Patrick,

      This feature is not available as of now. We are considering to implement the same in future version – but we don’t have a timeline yet.

In order to provide better support,we have closed the comments and switched completely to our Forums.
If you have any questions, please feel free to ask in our forums.