There is a label at this graphic: http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/combo/ label is "Total fruit consumption"
After chart created, how can I change that sentence dynamically?
PS: I tries to set labels and redraw graphic but didn't work: http://jsfiddle.net/UXDqL/
Any ideas?
Insted of using labels, you can use renderer text () and then use variable to keep object. If you need update dynamically this text, only what you need is use attr() function and update.
http://jsfiddle.net/6GKCJ/2/
var title = chart.renderer.text('Total fruits consumption', 100, 90)
.css({
fontSize: '12px'
})
.add();
$('#btn').click(function(){
title.attr({
text:'newText'
});
});
If you want to change it after the plot is drawn, just act on the element itself. Using jquery selectors it's as easy as:
// find me the tspan containing the specified text and change it to...
$("tspan:contains('Total fruit consumption')").text("Something New")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With