Chartjs-Chartjs xAxes gridline html (html in ticks callback)

1👍

You cannot define HTML but in order to obtain multi-line tick labels, simply let your xAxes.ticks.callback function return an array.

In your case, this could look as follows:

xAxes: [{
  ticks: {
    callback: v => [Math.abs(v) + '%', 100 - Math.abs(v)]
  }
}]

Leave a comment