Highcharts Demo
author(s):
Torstein Hønsi
HTML
<script src="http://code.highcharts.com/highcharts.src.js"></script>
<div id="container" style="height: 300px"></div><button id="b1"> update labels</button>
JavaScript
$(function() {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
series: [{
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],
tooltip: {
valueDecimals: 2,
valuePrefix: '$',
valueSuffix: ' USD'
}},
{
data: [71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4, 12],
tooltip: {
valueDecimals: 2,
valuePrefix: €'',
valueSuffix: ' EUR'
}}]
});
$('#b1').click(function(){
console.log(chart);
chart.xAxis[0].options.labels.style.color = 'blue';
chart.yAxis[0].options.labels.style.color = 'blue';
chart.xAxis[0].isDirty = true;
chart.yAxis[0].isDirty = true;
chart.redraw();
});
});