Is it possible to change the axis title of a HighCharts chart programatically?
I\'m trying to do something like this:
charts.series[0].yAxis.title.text =
I have created a demo fiddle to dynamically change y-axis title. Refer this JSFIDDLE
HTML:
JS (part of thec code to update the y-axis title on a button click):
var chart = $('#container').highcharts();
$('#my_btn').click(function(){
//alert('hey');
chart.yAxis[0].update({
title:{
text:"My text"
}
});
alert('Y-axis title changed to "My text" !');
});
Refer Highcharts 'update' function documentation for further details.