I want to update the dataSource of my chart based on a selection in a kendoDropDownList, however no change is applied (and neither do I see exceptions).
I tried setting chart.dataSource.data too, but that also didn't work.
$(
'#parking-filter-select'
).kendoDropDownList({
dataSource: usageData,
change:
function
(e) {
var
value = $(
'#parking-filter-select'
).val();
var
chart = $(
'#chart-utilization'
).data(
"kendoChart"
);
chart.dataSource =
new
kendo.data.DataSource({
data: usageData[value].Usage
});
chart.refresh();
}
});
$(
'#chart-utilization'
).kendoChart({
title: {
text:
"Parking utilization for week"
},
dataSource:{
data: usageData[0].Usage
},
series:[{
type:
"column"
,
field:
"Max"
,
name:
"Max utilization"
}],
categoryAxis:{
field:
"Week"
},
tooltip: {
visible:
true
,
template:
"${ Max } of ${ Capacity }"
},
legend: {
visible:
false
}
});
I tried setting chart.dataSource.data too, but that also didn't work.