This is a migrated thread and some comments may be shown as answers.

Hot to update the Title on an existing chart?

2 Answers 81 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Joe Sugden
Top achievements
Rank 1
Joe Sugden asked on 12 Sep 2012, 03:10 PM
var chart = $("#chart").data("kendoChart");
chart.title.text = "Test";

Does not do it.
I get a JS exception:

Error: TypeError: chart.title is undefined

Thanks in advance for any help!

2 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 13 Sep 2012, 03:33 PM
Hello Joe,

You could reach the title via the chart's options. For example: 
var chart = $("#chart").data("kendoChart");
chart.options.title.text("Test");

Please note that in order to get the updated title you need to refresh the chart: 
chart.refresh()

I hope this helps. 

Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Joe Sugden
Top achievements
Rank 1
answered on 13 Sep 2012, 06:10 PM
This worked:

chart.options.title.text = "Test";
Tags
Charts
Asked by
Joe Sugden
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Joe Sugden
Top achievements
Rank 1
Share this question
or