Open rdatasculptor opened 1 year ago
Whenever I need to configure the formatting of the text/number displayed in the tooltip, I use JS. I would love to know when there is the possibility to use HTML as well.. :)
@beatrizmilz I agree, but the inconvenience I encounter is that the label can't deal with html like the way tooltip does
I think echarts expects us to use the rich
option for that but it's a bit convoluted.
See https://echarts.apache.org/examples/en/editor.html?c=doc-example%2Ftext-block-fragment
I must admit I never really tried that. My first thought was: why choose such a complex approach instead of regular html? But this example is quite clear. Thank you for pointing us to it @JohnCoene !
Your initial intuition looks good to me: it should work. I'm not sure why echarts.js does not allow HTML in the labels.
Life would be a lot easier if I was allowed to use HTML in label formatting like the way that is possible in tooltips :) Is there a way, or a hack of some kind that would make this possible?
As an example, let's compare formatting of labels and tooltips:
As you can see, the label formatter doesn't know how to use HTML, whilst the tooltip formatter does. Is there a way to make label formatter behave the same way as the tooltip formatter?
Many thanks in advance!