score:1

Accepted answer

Wergeld's answer is correct,but I've found another solution.

We can extend YAxisTitle using inheritance and add property UseHtml.

public class YAxisTitleExtend : YAxisTitle
{
     public bool? UseHTML { get; set; }
}

And using YAxisTitleExtend instead of YAxisTitle.

If another not explicitly properties have appeared,we can simply add theirs to extend class.

score:1

Looking at the API docs for HighCharts the xAxis and yAxis titles do not have the property to use HTML. However, it is still present:

yAxis: {
    title: {
        text: 'СН<SUB>3</SUB>СНО',
        useHTML: true,
        style: {
            color: 'red'
        }
    }
}

The DotNet.Highcharts API only exposes items that are in the HighCharts API explicitly. This is one of the reasons we stopped using it. You could add an event in the chart.events.load section to set the axis title useHTML property:

chart: {
    events: {
        load: function (event) {
            this.yAxis[0].setTitle({
                useHTML: true,
            });
        }
    }
},
yAxis: {
    title: {
        text: 'СН<SUB>3</SUB>СНО'
    }
}

Live demo of using load event.


Related Articles