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

How to add multiple lines series dynamically in chart

2 Answers 1587 Views
Charts
This is a migrated thread and some comments may be shown as answers.
SUSHAMA
Top achievements
Rank 1
SUSHAMA asked on 18 Jan 2013, 01:56 PM
Hi,
I am trying to create a chart with multiple line series on it. Data source for the chart is setting dynamically so i can change the series value at run time (live mode) .Chart with single line is working properly in my web application, but i want to add multiple line series and set the values dynamically . Is there any way to do it ? How can i change values of multiple line series ?

2 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 18 Jan 2013, 05:37 PM
Hi SUSHAMA,

Generally speaking, Kendo UI Chart does not support dynamic changes neither on its DataSource, nor on its configuration. In order to achieve this you should manually add the new series and data via the chart options and recreate the chart.  For example:
var chart =  $("#chart").data("kendoChart");
var chartOptions = chart.options;
 
//add series
chartOptions.series.push({});
//....
 
//add data to particular series
chartOptions.series[3].data = [//....]
//....
 
//recreate the chart
chart.redraw();

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
Jayesh Goyani
Top achievements
Rank 2
answered on 23 May 2013, 10:41 AM
Hello,

Please use "field" in-place of "data".

For check below link for whole code.
http://jayeshgoyani.blogspot.in/2013/05/how-to-add-multiple-lines-series.html

Thanks,
Jayesh Goyani
Tags
Charts
Asked by
SUSHAMA
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Jayesh Goyani
Top achievements
Rank 2
Share this question
or