You need to sign in to do that
Don't have an account?
SFDC_Learner
Multi Color Bar
HI
I am working with multi colored bar charts.
I have 5 fields, and get a list throuth wrapper and displayed in <apex:chart/> and working fine.
Questions is,
<apex:barSeries title="R1,R2,R3,R4,R5" orientation="horizontal" axis="bottom" xField="data,data1,data2,data3,data4" yField="name" colorSet="blue,Magenta,Yellow,LightSeaGreen,cyan" stacked="true">
<apex:chartTips height="20" width="120"/>
</apex:barSeries>
In above code, How can i add a dynamic color for the values based on filter...
For ex,
IF(R1>0 && R1 <=10) : Color should be red
IF(R!>10 && R1<=20) : Color should be green .. etc
like this based on a specific criteria i want to add a color value in colorSet.
In General we can bind the IF() in "Style" tags and then we can apply the conditions accordingly.
But here barseries is not having a "Style" tag to do this.
Any Idea!
Thank you
You can use merge syntax in the colorSet atrribute. For example, I have a chart where the bar color is set by the controller and I can access the controller property as follows:
So you can embed your IF etc exactly as you would in a style attribute for other components.
HI Bob,
Thanks for the reply.
It is working fine when we have a single record.
But How it can works for multi records. I want to apply this for all the records...
Page:
The color set applies to the bars plotted for that series - you can't change the colour of the bars inside a series based on the values.