casillas
casillas

Reputation: 16813

Color Assign kendo chart

I have two dataseries and want to give different colors as follows. However no matter I assign different color, I am ending up with same color which is color of the last series (#006666).

 self.dataSeries[0].color = "#66FF66";
 self.dataSeries[1].color = "#006666";
 chart.options.series = self.dataSeries;

Upvotes: 0

Views: 125

Answers (1)

himawan_r
himawan_r

Reputation: 1780

This is the way you do it,

  1. first acess kendo chart > options > series[index] > color, then give the color you want
  2. refresh the kendo chart

Here code example :

$("#chart").data("kendoChart").options.series[0].color = "#66FF66";
$("#chart").data("kendoChart").options.series[1].color = "#006666";
$("#chart").data("kendoChart").refresh();

DEMO

Note : There is a chart and a button assign new color to change the series color

Upvotes: 1

Related Questions