Search code examples
highchartsmathjax

Rendering Mathjax in Highcharts


I'm trying a number of different ways to render mathjax in highcharts but nothing is working! Please let me know if this is possible. You can see in the fiddle that Mathjax is being rendered, just not in the chart:

categories: [
        '\(+x \)',
        '\\(+x \\)',
        '/\(+x /\)',

http://jsfiddle.net/nscozzaro/nr986r0x/


Solution

  • Your format '\\(+x \\)' is already being replaced in Highcharts, however, you have not enabled HTML for the labels. Simply add this code:

    xAxis: {
        labels: {
            useHTML: true
        }
        categories: [
            '\\(+x \\)',
            // ...
        ]
    }
    

    Or see this updated JSFiddle example.

    The same useHTML feature exists for legend, series.dataLabels, title, subtitle, tooltip and a few other places where you can use text. If in doubt, search the API.