How to set subscript text in Chart.js axis title #8544
-
Is there any way to set a subsript text like
for an axis title in Chart.js. Thx in advance |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There is no build in way tp do this, you can only provide valid unicode subscript. (https://jsfiddle.net/Leelenaleee/p025vr6h/2/). If you want subscript in the axis title the best thing you can do is set See this stack issue for more info about subscript in a canvas: https://stackoverflow.com/questions/8326191/html5-canvas-subscript-and-superscript |
Beta Was this translation helpful? Give feedback.
There is no build in way tp do this, you can only provide valid unicode subscript. (https://jsfiddle.net/Leelenaleee/p025vr6h/2/).
If you want subscript in the axis title the best thing you can do is set
display
totrue
,labelString
to an empty string and use the space yourself to draw the text. You can achieve your subscript by making the font smaller and moving the y position of the text.See this stack issue for more info about subscript in a canvas: https://stackoverflow.com/questions/8326191/html5-canvas-subscript-and-superscript