Harshrossi
Harshrossi

Reputation: 287

Setting color for the line in line series chart in extjs 4.2

I was trying to set custom color for the line series in extjs chart.

The thing is the color gets affected only to the dots and not to the whole line.

I am using renderer config in line series to achieve this.

Here is the code snippet:

{
  type: 'line',
  axis: 'left',
  //fill: true,
  //fillOpacity: 0.5,
  xField: 'month',
  yField: 'plan_cost',
  renderer: function (sprite, record, attr, index) {
       var color = '#faf56c';//RED COLOR

       return Ext.apply(attr, {
           fill: color
       });
  }
}

This is how it appears:

enter image description here

What should I do to change the line color too?

Upvotes: 1

Views: 4089

Answers (1)

Zero Cool
Zero Cool

Reputation: 1936

You could try the following style on your line series config:

style: {
     stroke: '#ff0000',
     fill: '#ff0000'
}

Here's a fiddle showing this in action with 4.2.0: http://jsfiddle.net/aPn3s/1/

Upvotes: 1

Related Questions