I have did my research on chart with angular. However, I can't find a good example for using angular with donut chart. The example that is demon online isn't good enough. First, The demon donut chart code is creating different series. I want to be able to just create one series with different categories. And secondly, I want to load the data dynamically. I got it work with static data. Now, I have to know how to load dynamic data to donut chart. I didn't get it work by using k-data-resource.
HTML:
<div kendo-chart k-options="backupchart" k-tooltip="backuptooltip" k-legend="backuplegend" ></div>
AngularJS:
$scope.backupData = [{
category: "file system",
value: 28,
color: "#009DD6"
},{
category: "sql server",
value: 12,
color: "#F2B33D"
},{
category: "db2",
value: 8,
color: "#90CC38"
},{
category: "oracle",
value: 7,
color: "#FF5444"
},{
category: "hyperV",
value: 8,
color: "#D9D9D9"
}, {
category: "Office365",
value: 2,
color: "#D96CC7"
}];
$scope.backupchart = {
series: [{
data: $scope.backupData,
overlay: {
gradient: "none"
}
}],
seriesDefaults: {
type: 'donut',
style: 'smooth'
}
};
Suppose $scope.backupData is coming from a remote server. How can I redraw into donut chart? I can get the data no problem.
Thank you in advanced.