Angular Code to update datasource:
$scope.bindGroupCost = function (groupCostData) {
$scope.bindGroupCostData = new kendo.data.DataSource({ data: groupCostData });
$scope.bindGroupCostData.read();
}
HTML Code:
<div class="k-content">
<div>
<div kendo-chart
k-title="{ text: 'Group Total Cost', position: 'bottom' }"
k-series-defaults="{ type: 'pie' }"
k-series="[{ field: 'groupCost', categoryField: 'groupName', padding: 0 }]"
k-tooltip="{ visible: true, format: 'Group Cost: {0} £' }"
k-data-source="bindGroupCostData"
k-series-hover="onSeriesHover"
style="width:100%; height:350px; border:1px;"></div>
</div>
</div>
Calling angular function from javascript:
angular.element(document.getElementById('tblContainer')).scope().bindGroupCost(JSON.parse(slices));
My problem is that when I am updating the 'slices' values at runtime, kendo pie chart is not updating the datasource and pie chart is not updating.
Please let me know how to refresh the keno chart when datasource is updating at runtime.
Look forward to hear from you.
Let me know if you need any more details..