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

Kendo Stock Chart with Dynamically Updated Data

7 Answers 142 Views
Charts
This is a migrated thread and some comments may be shown as answers.
developer
Top achievements
Rank 1
developer asked on 23 Mar 2016, 06:45 AM

Hello,

Thank you for the example on Kendo-Stock chart using AngularJS.

I want to create a kendo stock chart using AngularJS which should be based upon dynamically updated data.But I am able to do with a fixed period of time only.
Can you suggest me the solution with an example?

 

Regards,
Adyasha

7 Answers, 1 is accepted

Sort by
0
developer
Top achievements
Rank 1
answered on 24 Mar 2016, 09:56 AM

I'm expecting the functionality as given in this fiddler.

0
T. Tsonev
Telerik team
answered on 25 Mar 2016, 10:05 AM
Hi,

The StockChart will respond to changes in the underlying data source.

See this dojo demo for an example. I had to manually update the navigator range.
Will investigate if this can be fixed.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
developer
Top achievements
Rank 1
answered on 28 Mar 2016, 04:12 AM

Hello Tsonev,

I'm not able to access the demo link. Can you paste the code in comment please.

I believe the dojo site is down.

0
developer
Top achievements
Rank 1
answered on 28 Mar 2016, 08:49 AM

Hello Tsonev,

Thanks for the example. But I don't want to render the chart every-time. It should append the new data into the chart series. I'm expecting the smooth render as per the example from fiddler.

In my app, I'm going to get the data for every few seconds or minutes. so I should render the chart with new data with smooth render.

Is't possible to render like that in kendo chart.

Thanks.

0
EZ
Top achievements
Rank 2
answered on 28 Mar 2016, 01:55 PM

You can turn off transitions in the chart:

Updated DOJO

0
developer
Top achievements
Rank 1
answered on 29 Mar 2016, 10:15 AM
Hi EZ,

Thanks for reply. As I'm using series to bind data to kendo chart instead of data source add,remove,at methods are not working,here is the DOJO Example i tried with simple JavaScript functions,its not working.

Is there any other solution for dynamically updating data with series data binding.

Thanks
0
Accepted
EZ
Top achievements
Rank 2
answered on 29 Mar 2016, 12:42 PM

When updating series instead of a dataSource, you need to explicitly tell the chart to refresh

var chart = $("#chart").data("kendoChart");
var ds = chart.options.series;
kendoConsole.log("Before : "+ JSON.stringify(ds[0].data));
var index = ds[0].data.indexOf(ds[0].data[0]);
ds[0].data.splice(index, 1);        
ds[0].data.push(Math.floor(Math.random()* 12));
kendoConsole.log("After : " + JSON.stringify(ds[0].data));
              
chart.refresh();

Updated DOJO

Tags
Charts
Asked by
developer
Top achievements
Rank 1
Answers by
developer
Top achievements
Rank 1
T. Tsonev
Telerik team
EZ
Top achievements
Rank 2
Share this question
or