Pages

Creating Chart with Multiple Y Axis

With CanvasJS, you can create and add any number of axis as shown in this tutorial.

Here are the steps:

Step1:

Position the chart container wherever the chart is supposed to be rendered in the page.

HTML:

<div id="chartContainer"></div>

Step2:

Create multiple Y axis chart with axisY as an array of objects and axisYIndex assigned at dataSeries level that corresponds to axis to which it has to be attached. And assign it to specific chart-containers where chart is supposed to be rendered. And call corresponding chart render method to render the chart.

Finalising

To summarize, in order to create chart with multiple axis, you should create a new chart with axisY as array of objects and attach every dataSeries to its corresponding axisY using axisYIndex. And call chart.render()

Below is the compilation of final code.

Try it Yourself by Editing the Code below.

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.