score:2

Accepted answer

you can use the plugin core api that offers a range of hooks that may be used for performing custom code. to draw the scale labels on top of the different yaxes in your code sample, the afterdraw hook could be defined as follows. it uses canvasrenderingcontext2d.filltext() to draw text directly on the canvas.

plugins:[{
  afterdraw: chart => {
    var ctx = chart.chart.ctx;
    ctx.save();
    ctx.font = "bold 14px arial";
    ctx.fillstyle = "gray";
    var y = 50;

    ctx.textalign = 'left';        
    ctx.filltext('co2', 5, y);
    ctx.filltext('°c', 46, y);

    ctx.textalign = 'right';
    ctx.filltext('%', chart.chart.width - 10, y);
    ctx.restore();
  }
}],

please have a look at your amended jsfiddle

score:0

https://github.com/chartjs/chart.js/issues/3706

it's still not supported,but there is a way to workaround.

title: { display: true, text: ['realtile','leftscalelabel...............................

many space....................................................... rightscalelabel'] },


Related Query

More Query from same tag