I am trying to bind a kendoChart to a datasource and get the following error: "Uncaught TypeError: Cannot call method 'slice' of undefined".
I used the bar chart example from the Telerik demo's and changed the json to add some metadata for the chart.
My json looks like this:
My datasource looks like this:
and I'm creating the chart like this:
I got this to work using the Kendo example with the "flat" json file but I'm trying to add some metadata to the json so the bar chart can be formatted with title, legend position, etc.
I used the bar chart example from the Telerik demo's and changed the json to add some metadata for the chart.
My json looks like this:
[
{
"chartitems": [
{
"high": 50,
"index": 0,
"low": 180,
"medium": -34,
"name": "Building 0"
},
{
"high": 45,
"index": 1,
"low": 145,
"medium": 22,
"name": "Building 1"
},
"Title": "test",
"LegendPosition": "top"
}
]
My datasource looks like this:
var
dataSource =
new
kendo.data.DataSource({
transport: {
read: {
url:
"data/chart.json"
,
dataType:
"json"
}
},
schema: {
data:
"chartitems"
}
});
and I'm creating the chart like this:
var
bar = $(
"#chart"
).kendoChart({
dataSource: dataSource,
categoryAxis: {
field: "name"
},
series: [{
name: "Medium",
field: "medium"
},
{
name: "Low",
field: "low"
}]
});
...
I got this to work using the Kendo example with the "flat" json file but I'm trying to add some metadata to the json so the bar chart can be formatted with title, legend position, etc.