Chartjs-Chart.js Labelling – Need Two Labels on Y-axis of Horizontal Bar Chart

0👍

Update:

I resolved this issue by using labelString – see chart.js docs for details.

In particular:

yAxes: [{
                        gridLines: {
                            color: "rgba(0, 0, 0, 0)",
                        },
                        ticks: {
                            beginAtZero: true,
                            display: true,    
                            mirror: true,                               
                        },
                        scaleLabel: {
                            display: true,
                            labelString: [
                                    var0+'                  '+
                                    var1+'                  '+
                                    var2
                        ]
                        }
                    }]

This is a bit of a hack as I needed to add 18 spaces between var0 and var1 but reviewed on multiple devices and it works.

If someone else found a different solution please share. If not, I hope this helps someone.

Image of update below – with months now on the y-axis:
enter image description here

Leave a comment