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

How do I change the theme of a stockchart on the fly?

3 Answers 57 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Jonathan Travis
Top achievements
Rank 1
Jonathan Travis asked on 24 Feb 2014, 07:31 PM
For a standard chart, I just need to use the setOptions method

curChart.setOptions({ theme: "black"});

However, when I try this for a stock chart, I get a null reference error.  

I looked at the documentation of the stock chart and it doesn't mention having the setOptions method.  

Is it possible to change the theme?

3 Answers, 1 is accepted

Sort by
0
Iliana Nikolova
Telerik team
answered on 25 Feb 2014, 04:05 PM
Hi Buddy,

You are right - there is no a setOptions method for the StockChart. The only possible approach for changing the theme of Kendo UI StockChart at this point is to recreate the chart (as demonstrated in the online demos).

Regards,
Iliana Nikolova
Telerik
0
Jose Mejia
Top achievements
Rank 1
answered on 17 Jun 2015, 07:41 PM

Hi, Iliana!

Are there any changes related to set different settings for series related to StockChart? I can change series (label, field and so on) via chart.options.series = newSeries and then refresh and redraw (or simply redraw), but I found that navigator series couldn't be changed the same way. Am I right? Now I have to recreate the chart but it is very inconvenient because I loose current view...

Thanks in advance.

 

 

0
T. Tsonev
Telerik team
answered on 19 Jun 2015, 01:21 PM
Hi,

I'm afraid the Stock Chart does not leave much room for changing settings on the fly. Our recommendation is to re-initialize the widget.
You can keep a reference to the original options in order to reuse and extend them:
var options = { .... };
$("#stock-chart").kendoStockChart(options);
...
options.navigator.series[0] = { ... };
$("#stock-chart").kendoStockChart(options);


I hope this helps.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Charts
Asked by
Jonathan Travis
Top achievements
Rank 1
Answers by
Iliana Nikolova
Telerik team
Jose Mejia
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or