Hi, Im trying to bind a chart with json, but I cant get it to work.
Here is how the json looks like.
Here is how the json looks like.
{"d":{"__type":"test.PersonSearchSummary","TotalSearches":300,"Hits":250,"Alternates":30
,"Misses":20}}
Here is how i try to create the chartfunction
createChart() {
$(
"#chart"
).kendoChart({
theme:
"kendo"
,
title: {
text:
"Internet Users"
},
legend: {
position:
"bottom"
},
seriesDefaults: {
type:
"column"
,
stack:
true
},
dataSource: {
transport: {
read: {
type:
"POST"
,
contentType:
"application/json; charset=utf-8"
,
url:
"Default.aspx/GetPersonSearchData"
,
dataType:
"json"
}
}
},
series: [{
name:
"PersonSearch"
,
field:
"TotalSearches"
}, {
name:
"United States"
,
field:
"Hits"
}],
valueAxis: {
majorUnit: 1000
},
categoryAxis: {
field:
"test.PersonSearchSummary"
},
tooltip: {
visible:
true
,
format:
"{0}%"
}
});
}
$(document).ready(
function
() {
createChart();
$(document).bind(
"kendo:skinChange"
,
function
(e) {
createChart();
});
});