I have this code for diaplaying a pia chart, largely taken from telerik examples:
<div id="chart100Month" style="width:100%"></div>
<script type="text/javascript">
function createChartMonth100() {
//console.log('createChartMonth100');
$("#chart100month").kendoChart({
dataSource: {
transport: {
read: {
url: "/getchartdatabytesttype100",
dataType: "json"
}
},
filter: {
// field: "year", operator: "eq", value: year
},
sort: {
// field: "year",
// dir: "asc"
}
},
title: {
text: "test"
},
legend: {
position: "top"
},
seriesDefaults: {
type: "pie"
},
series: [{
type: "pie",
field: "percentage",
categoryField: "type",}],
tooltip: {
visible: true,
format: "N0",
// template: "#= category # - #= kendo.format('{0:P}', percentage)#"
}
});
}
$(document).ready(createChartMonth100);
$(document).bind("kendo:skinChange", createChartMonth100);
</script>
the url getchartdatabytesttype100 gives back a json array:
[{
"percentage"
:0,
"type"
:
"hypo"
},{
"percentage"
:66.666666666667,
"type"
:
"normal"
},{
"percentage"
:16.666666666667,
"type"
:
"lighthyper"
},
"percentage"
:16.666666666667,
"type"
:
"hyper"
}
But the problem is that firebug console showd the datasource is not read.
No calls to getchartdatabytesttype100 are made and the chart (even an empty) is not created, but I'm sure kendoChart function is called.
Do you have any suggestions about it?
Thanks
Paolo