add support for subscripts and superscripts to the Renderer buildText function.
Currently, the buildText function doesn't render subscripts and superscripts in the SVG output, but subscripts and superscripts are supported in SVG 1.1 using the baseline-shift attribute on the tspan element. Please add support for parsing <sub> and <sup> tags and rendering them as appropriate tspan elements.
-
Ben commented
Excellent, that worked. Thanks!!
-
@Ben Yes, as long as you set legend.useHTML to true.
-
Ben commented
Can a similar method be used for series names to be included in legends?
-
Erlend commented
You can use the html <sup> and <sub> thusly:
xAxis: {
categories: ['y<sub>1</sub>', '', 'x<sup>2</sup>'],
labels: {
useHTML: true
}
}and in tooltips:
tooltip: {
formatter: function() {
return ''+ this.series.name +': '+ this.y +' <sup>millions</sup>';
},
useHTML: true
},