Chartjs-Labels appear twice using tick.mirror in horizontal bars

2👍

Assume that you want to display the y-axis label within the bar chart only.

From the documentation,

Default scale override has been removed if the configured scale starts with x/y. Defining xAxes in your config will now create a second scale instead of overriding the default x axis.

You should use the y which is the default y-axis instead of yAxis.

scales: {
  y: {
    ticks: {
      mirror: true,
    }
  }
}

Demo @ StackBlitz

Leave a comment