Jugal | Changing tooltip formatter dynamically | Highchart & Highstock
http://stackoverflow.com/questions/13479476/change-highcharts-tooltip-formatter-from-chart-object-after-chart-is-rendered/13480390#13480390
Jugal Thakkar
http://jugal.me/
by jakub_noga_antsolutions
HTML
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>
<script type="text/javascript" src="http://code.jugal.me/js/jugalsLib.js"></script>
<script type="text/javascript" src="http://code.highcharts.com/stock/highstock.src.js"></script>
<script type="text/javascript" src="http://code.highcharts.com/stock/modules/exporting.src.js"></script>
<div id="container"></div>
<button>Change tooltip</button>
CSS
#container {
min-width: 500px;
}
JavaScript
var chartingOptions = {};
chartingOptions = $.extend({}, jugalsLib.getBasicChartOptions(), chartingOptions);
var chart = new Highcharts.StockChart(chartingOptions);
$("button").click(function() {
$(this).attr('disabled', 'disabled');
chart.update({
tooltip: {
pointFormat: "AVC"
}
});
});