1
votes

I'm wondering is there any way to change valueSuffix of tooltip after chart is rendered?

I'm trying to do switch from metric units to imperial, so I need to change data, yAxis label and tooltip valueSuffix. It was simple for first two, but I didn't find anything about third, neither in docs (like yAxis update(..)), neither in google.

Tried this:

$('#sp_chart').highcharts().tooltip.options.valueSuffix = 'aaaa';

in

console.log($('#sp_chart').highcharts().tooltip.options.valueSuffix) 

it looks good, but didn't works when tooltip shows.

1

1 Answers

2
votes

You can define a suffix in the series object, and use series update to modify this parameter.

series: [{
        tooltip:{
            valueSuffix: ' USD',
        },
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
    }]
/*...*/
    chart.series[0].update({
                tooltip:{
                valueSuffix: ' EUR',
            },
    });

Example: http://jsfiddle.net/Ujw8B/