Reputation: 5075
I need to change dynamically legend labels and I was surprised when I have not found method like chart.legend.setLabels()
I tried this
chart.legend.allItems[0].name = 'bla bla'
chart.legend.redraw()
nothing happend
tried to change options
chart.options.legend.labels[0].name = 'bla bla'
chart.redraw()
nothing happend
So is there way to change legend label name?
Upvotes: 5
Views: 20143
Reputation: 528
You could also use
chart.series[0].update({ name: "hello"});
http://jsfiddle.net/bL5ZM/149/
Upvotes: 1
Reputation: 37588
You can use update() function
chart.legend.allItems[0].update({name:'aaa'});
Upvotes: 11