[Chartjs]-How to use both left and right yAxes in ng2-chart?

2👍

Replace yAxesID by yAxisID inside your datasets and it will work as expected.

datasets = [
  {
    data: [3, 10, 4],
    label: 'Application number',
    yAxisID: 'y-axis-l'
  },
  {
    data: [2, 4, 1],
    label: 'Applied',
    yAxisID: 'y-axis-l'
  },
  {
    data: [66.66, 40, 25],
    label: 'Percent',
    type: 'line',
    yAxisID: 'y-axis-r',
    backgroundColor: 'rgba(0,0,0,0)'
  },
];

Please take a look at your amended StackBlitz and see how it works.

Leave a comment