Hi Daniël,
Please take a look at this Telerik Dojo illustrating an updated version of your sample.
Here are the changes:
1. The data is stored in a Kendo DataSource so I can use the dataItems.
2. The colors are set by using the dataIndex for each item in the series. (I outputted to the console each object for your observation.)
You can also keep your color scheme if you add more items in your data as shown in this dojo.
3. To add the name of each item, use the dataItems with a template in the tooltip:
Hopefully, this helps.
Regards,
Patrick
Telerik
Please take a look at this Telerik Dojo illustrating an updated version of your sample.
Here are the changes:
1. The data is stored in a Kendo DataSource so I can use the dataItems.
2. The colors are set by using the dataIndex for each item in the series. (I outputted to the console each object for your observation.)
series: [{
...
color: function(e) {
var colors = ["#CF5B6B", "#96945C", "#7C647E", "#7D8EBD", "#F1C736"];
var index = e.index % colors.length;
return colors[index];
}
}],
You can also keep your color scheme if you add more items in your data as shown in this dojo.
3. To add the name of each item, use the dataItems with a template in the tooltip:
tooltip:{
template: "#=dataItem.name # #=value #",
visible: true
}
Hopefully, this helps.
Regards,
Patrick
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!