Search code examples
asp.net-mvctelerikkendo-asp.net-mvckendo-datavizkendo-chart

kendoChart - Refresh only bars not whole graph


I implemented kendo chart of Telerik and below is my code after applying updated values.

I would like to smoothly update only bar - like below LINK:

http://www.jqueryscript.net/demo/Dynamic-Animated-jQuery-Bar-Charts-Plugin-LiveGraph/demo/

My existing code to refresh graph is:

var chart = $("#divBarChart").data("kendoChart");
chart.options.series[0].data = globalSeriesValue
chart.refresh();

Please guide.


Solution

  • in Kendo - the Chart API exposes setDataSource() method. So when you say you want to refresh just the bars its actually nothing but providing a new data source to the chart. This way the chart is not redrawn rather just the points on the chart are repainted.

    here is the documentation link:http://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/chart#methods-setDataSource

    I have created a demo for you here: http://dojo.telerik.com/@kashyapa/Ekara