I am having some troubles binding my chart. I am trying to create a datasource that is bound to my mvc3 controller
Basically I am trying to dynamically bind the series. As I dont know what the values are going to be.
The controller is called and the json is returned however nothing is shown in the graph.
What am I doing wrong? I am not getting any javascript errors.
Basically I am trying to dynamically bind the series. As I dont know what the values are going to be.
The controller is called and the json is returned however nothing is shown in the graph.
What am I doing wrong? I am not getting any javascript errors.
<script>
$(document).ready(
function
() {
setTimeout(
function
() {
createChart();
}, 400);
$(document).bind(
"kendo:skinChange"
,
function
(e) {
createChart();
});
});
function
createChart() {
var
dataSource =
new
kendo.data.DataSource({
transport: {
read: {
url:
"/MyService/GetGraph"
,
dataType:
"json"
// additional parameters sent to the remote service
// data: {
// q: "html5"
// }
},
group: {
field:
"TransactionTypeName"
,
dir:
"asc"
}
}
});
dataSource.read();
$(
"#chart"
).kendoChart({
theme: $(document).data(
"kendoSkin"
) ||
"default"
,
dataSource: { data: dataSource },
title: {
text:
"Transaction Details"
},
legend: {
position:
"bottom"
},
seriesDefaults: {
type:
"column"
},
series:
[{
field:
"TransactionAmount"
,
name:
"Transaction Name"
}],
categoryAxis: {
field:
"MonthString"
,
labels: {
rotation: -90
}
},
valueAxis: {
labels: {
format:
"{0:N0}"
}
},
tooltip: {
visible:
true
,
format:
"{0:N0}"
}
});
}
</script>