I wrote the code below, the data came to the web service but I couldn't
see any chart on the page.The title can be seen on the page(Pie Chart Test), the createChart function is called but datasource part does not work. If you can help, I would be glad.
Note: Json data is attached as data.json
<script>
function createChart() {
$("#chart").kendoChart({
theme: $(document).data("kendoSkin") || "default",
title: {
text: "Pie Chart Test"
},
legend: {
position: "bottom",
},
seriesDefaults: {
labels: {
visible: true,
format: "{0}%"
}
},
categoryAxis: {
field: "ID"
},
dataSource: {
transport: {
read: {
url: "Machine.asmx/GetDuration",
dataType: "json"
}
},
},
series: [{
type: "pie",
}],
tooltip: {
visible: true,
format: "{0}%"
}
});
}
$(document).ready(function () {
setTimeout(function () {
// Initialize the chart with a delay to make sure
// the initial animation is visible
createChart();
$("#example").bind("kendo:skinChange", function (e) {
createChart();
});
}, 400);
});
</script>
Note: Json data is attached as data.json
<script>
function createChart() {
$("#chart").kendoChart({
theme: $(document).data("kendoSkin") || "default",
title: {
text: "Pie Chart Test"
},
legend: {
position: "bottom",
},
seriesDefaults: {
labels: {
visible: true,
format: "{0}%"
}
},
categoryAxis: {
field: "ID"
},
dataSource: {
transport: {
read: {
url: "Machine.asmx/GetDuration",
dataType: "json"
}
},
},
series: [{
type: "pie",
}],
tooltip: {
visible: true,
format: "{0}%"
}
});
}
$(document).ready(function () {
setTimeout(function () {
// Initialize the chart with a delay to make sure
// the initial animation is visible
createChart();
$("#example").bind("kendo:skinChange", function (e) {
createChart();
});
}, 400);
});
</script>