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 |
Answered by
LeeLenaleee
Mar 2, 2021
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 |
0 replies
Answer selected by
kurkle
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to 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
displaytotrue,labelStringto 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