开发者

Change HighCharts axis title in 2.1.4

开发者 https://www.devze.com 2023-03-09 10:54 出处:网络
I\'d like to change the axis label (like Change HighCharts axis title) but : chart.yAxis[0].axisTitle.attr({

I'd like to change the axis label (like Change HighCharts axis title) but :

chart.yAxis[0].axisTitle.attr({
  text: 'new title'
})

This works in HighCharts 2.0.5 but doesn't开发者_Go百科 work anymore in 2.1.4…

Is this still possible?


Via @hfrntt, this works as a temporary fix :

 $(chart.yAxis[0].axisTitle.element).text('New Label');


What you've described should be correct. I've experimented with something just as simple: setting the chart title.

var chart = //... Simple chart definition

$button = $('#button');
$button.click(function() {
    chart.setTitle("Garbage");
    chart.redraw();
});

This simple example should also work, so I suspect you may have found a bug.


// this works as correct implementation and not a fix.

chart.yAxis[0].setTitle({'text':'My text'});

// highcharts forums

0

精彩评论

暂无评论...
验证码 换一张
取 消