If I provide this simple data to a KendoUI chart, the chart data shows up correctly.
var data = [
{"state":"NY","abc":12312},
{"state":"AZ","abc":12312},
{"state":"CA","abc":12312},
{"state":"VT","abc":12312}
];
Please note that the above JSON has STRINGS for the keys.
However, if I provide a number as a key, I get an “Unexpected number at line number 2156” error in kendo.all.js.
var data = [
{"state":"NY","1":12312},
{"state":"AZ","1":12312},
{"state":"CA","1":12312},
{"state":"VT","1":12312}
];
Any help?
This is a known issue / by design in Kendo’s DataViz charts: http://www.kendoui.com/forums/ui/general-discussions/kendo-datasource-field-name.aspx
The gist of it is that the keys from the JSON doc are used as variable names within the chart’s code, which means the keys must be valid JavaScript variable names.