View Full Version : conditional formatting of Bars in a Bar Chart

Syed Huda
23 Feb 2011, 2:52 PM
Anyone know how to do set colors of the bars in a bar chart based on some condition?
I know how to set the color through a 'style:' ie.

style: {
color: '#B40404'
When I have a negative value I want the bar to be RED.
When I have a positive value I want the bar to be GREEN.
Is there a way to use a renderer?

Please help.

24 Feb 2011, 7:38 AM
No, the Ext 3 chart component is rather limited.

You'll have to create 2 series, one for positive values and one for negative values and give each series a different color.

Syed Huda
24 Feb 2011, 8:52 AM
Will EXT 4 have conditional rendering capability?

24 Feb 2011, 9:04 AM
Haven't tried yet. I would suggest downloading the Ext 4 preview and try modify one of the examples to do this.