I am having problems with the datasource for a kendo chart.
Controller code:
$scope.data = new kendo.data.DataSource({
transport: {
read: _read
},
sort: ({ field: 'date', dir: "asc" })
})
function _read(e) {
$http.get(('checkinstats/'), {
}).then(response => {
e.success({
data: response.data
});
}).catch(response => {
e.error();
});
}
$scope.chartSeries = [{ field: 'count', name: '#= group.items[0].name #' }];
Chart code:
<div kendo-chart
k-series-defaults="{ type: 'line' }"
k-series="{{chartSeries}}"
k-data-source="{{data}}"</div>
This is the error message in the consol i get: TypeError: Cannot read property 'data' of undefined