I would like to display formatted text (using symbols, subscript, superscript etc) in the axis titles, legend entries etc of the lightningchart component. How can I accomplish this?
Asked
Active
Viewed 96 times
1
-
Could you give more concrete examples of your requirements (rich/formatted text)? If it is something that you can't provide as a string, then I am afraid it is not supported. But I would still be curious to know of your use case. – Niilo Keinänen Mar 21 '22 at 13:18
-
Sure! For instance, I'd like to use subscript for symbols, eg. t₀ or Pmax. The numerical ones can probably be solved by using a font with the subscript numbers as glyphs, but for other characters it seems to be harder. I would also like to be able to emphasize a part of a title or legend entry using bold or italic. – wiesener Mar 22 '22 at 15:47
-
1t₀ for one seems to work, for example Axis.setTitle("t₀"). something or similar ones definitely won't be working in the near future but might be something we can support in the future. – Niilo Keinänen Mar 22 '22 at 18:47
-
It's a bit surprising that a javascript plot library doesn't support basic html formatting. Would it be very difficult to add support for html strings? – wiesener Mar 22 '22 at 21:25
-
And is the same true for the legends, or is there support for HTML there? – wiesener Mar 22 '22 at 23:46
-
1This applies to all text LCJS components. It is because we have our own WebGL text rendering engine for performance reasons. Adding this is definitely somewhat complicated. – Niilo Keinänen Mar 23 '22 at 10:25
-
Gotcha. If possible, I would definitely appreciate a feature allowing some sort of text styling, if not full HTML functionality. You could for instance base it off of the API provided by the Unity TextMeshPro package: http://digitalnativestudios.com/textmeshpro/docs/rich-text/ – wiesener Mar 25 '22 at 11:50
1 Answers
0
Use setCursorFormatter for format text

Mohammad Ali Rony
- 4,695
- 3
- 19
- 33
-
I don't see how this solves my problem. The method takes a FormattingFunction, which returns a string. As far as I can see that string is not interpreted as html or rich text. Further, this function is for tick marks, but I need it for axis titles and legends. – wiesener Mar 21 '22 at 12:19