How to add multiple y axis dynamically

Hi, 
I am trying to make a multiple y-axis line series chart, I managed to add the series dynamically to line chart but every series is using the same vertical axis. 
1. How can I add series dynamically to line chart but with separate vertical axis for each added series. 
2. The vertical axis should be same color with line series added so we can differentiate the vertical axis easily. 
Attached is the chart that I would like to achieve. Could you provide us some example on how could we achieve this? 
Thanks in advance. 



Attachment: MultipleAxisChart_e73e05ef.zip

1 Reply 1 reply marked as answer

DG Durga Gopalakrishnan Syncfusion Team December 29, 2020 02:41 PM UTC

Hi Weng,

We suggest you use addAxes method to add multiple axis to chart. We have prepared sample and attached for your reference. 

<script>
    document.getElementById('button').onclick = () => {
        var chart = document.getElementById('container').ej2_instances[0];
        chart.addAxes([{
            name: 'yAxis1',
            lineStyle: { color: 'red' },
            title: 'Sales 1'
        }]);
  };
</script>


Kindly revert us if you have any concerns.

Regards,
Durga G



Marked as answer
Loader.
Up arrow icon