KalpaG
KalpaG

Reputation: 27

programatically change the color of a highcharts spline series?

i have a spline series. its color is blue. depending on some condition i want to change the color of it to green or red. how to do that. i tried the following way but it didn't work

var rawChart = Ext.ComponentQuery.query('kpiprojectrawvaluechart')[0];
var upperSeries = rawChart.series[0];
var lowerSeries = rawChart.series[2];

if(status == 'danger'){
  upperSeries.color = 'red';
}
else {
 upperSeries.color = 'green';
}

rawChart.refresh();

please help me

Upvotes: 0

Views: 1696

Answers (1)

Hardik Mishra
Hardik Mishra

Reputation: 14877

You can do using:

chart.series[0].graph.attr('stroke', 'green');

Here is the fiddle link : http://jsfiddle.net/mhardik/BCH9t/

Upvotes: 1

Related Questions