Hi. I have a single JSON Array like this:
[{
"country": "Spain",
"year": "2008",
"unit": "GWh",
"solar": 2578,
"hydro": 26112,
"wind": 32203,
"nuclear": 58973
}];
And, What I want to do is make this single array into a chart. (I hope the name of the series is the same as the axis text.)
Like this.
but, If I write code like this... All series are included in one category. How can I solve this?
var tempData = [{
"country": "Spain",
"year": "2008",
"unit": "GWh",
"solar": 2578,
"hydro": 26112,
"wind": 32203,
"nuclear": 58973
}];
$("#chart").kendoChart({
dataSource: {
data : tempData
},
series:
[{
field: "nuclear",
name: "Nuclear"
}, {
field: "hydro",
name: "Hydro"
}, {
field: "wind",
name: "Wind"
}],
categoryAxis: {
categories: ["Nuclear", "Hydro", "Wind"]
}
});
Hello J Jay,
What you are trying to achieve requires only one categoryAxis category and then you can use series.labels to display labels:
Dojo demo: https://dojo.telerik.com/EModOqeS
Please examine this and let me know if you have any questions.
Regards,
Nikolay