[Chartjs]-Chart.js – show duplicate y-axis on left and right sides

2👍

You can do it like this:

scales: {
  y: {
    position: "left",
  },
  y1: {
    position: "right",
    afterBuildTicks: (axis) => {
      axis.ticks = [...axis.chart.scales.y.ticks];
      axis.min = axis.chart.scales.y.min;
      axis.max = axis.chart.scales.y.max;
    },
  },
}

Leave a comment