EDIT : I have reproduced the issue in here .. http://dojo.telerik.com/@Salmal/OcALi
I am new to Kendo UI and I am using kendo directives in my angular app . I have a requirement to change the type of the the chart using an event . Let's say for an example when user clicks on a button i want to change the chart from bar chart to pie chart . Please refer my code below .
Controller.js
$scope.chartData = [
{
"name": "Books",
"amount": 200
},
{
"name": "Newspapers",
"amount": 320
},
{
"name": "Magazines",
"amount": 225
},
{
"name": "Shoes",
"amount": 400
}
];
$scope.update = function () {
$scope.ChartType = { type: 'pie' };
};
$scope.ChartType = {type: 'bar' };
View.html
<div class="demo-section k-content wide">
<div>
<h4>Hover some series</h4>
<div kendo-chart
k-legend="{ position: 'bottom' }"
k-series-defaults="ChartType"
k-series="[{ field: 'amount', categoryField: 'name'}]"
k-data-source="chartData"
k-rebind="chartData">
</div>
</div>
</div>
<button kendo-button ng-click="update()">
Update from code
</button>
In the above code the update()
function get executed successfully , also assigning "pie" chart type to the $scope.ChartType
variable . But this doesn't reflect in the view . Which means the Angular model binding isn't working . I am missing something fundamental here ? Any help would be much appreciated ..