Chartjs rotate text

0

I would like to know, I have a text created with canvas on chartJS]. How do I rotate the text, while being vertical in the center of the line. I tried Rotate, but the text disappeared from the graph.

EXAMPLE

link

    
asked by anonymous 13.04.2017 / 20:36

1 answer

0

canvas has the translate () and rotate () methods that can help in this situation:

ctx.translate(xaxis.getPixelForValue(undefined, index) -16, yaxis.top + 5);
ctx.rotate(-90*Math.PI/180);
ctx.fillText("ROTATE", 0, 0);
    
20.05.2017 / 18:40