Hi,
This is regarding the bar graph coloring in webI. Actually BO uses colors from pallete available, I am able to change colors in palette.
Now my requirement is that color assignment should be done based on value of a particular field named “Severity”. I have different item id, groups and severity. Chart shows count of items based on the groups. Now for a single group there can be different counts based on severity. My requirement is bar color should be selected based on the value of severity. Like if Severity is “High” color should be RED, if severity is “Low”, color of bar should be green but graph picks colors from palette dynamically and assigns the color based on returned data.
Conditional color assignment: Is there a way to hard code the colors of bars based on value of a particular field?
Also, please mention if any other trick or work-around is known for this.
Hi Aniket,
Thanks but I had to come to you people, actually I played a lot with alerters, they work on tables but when I convert them to chart the alerter stops working and colors are picked from palette. I tried sorting the severity field (there are 5 values) and hard coded colors in palette but in some case I didn’t get all the values only 2 values returned for severity so my hard coding failed, the wrong colors were assigned to those values. Other than I have put alerter in table in same report so it won’t be in sync with the table.
Is there any other way?
I am afraid as I think you cannot change Bar colors. But of course text color of X-axis and Y-axis and background of the texts or grid view can be done… . And might this can be solved by playing around BO files like time stemp problem for Calender can be solved by changing BO installation files. I am not sure about this, just guessing…
Also I tried from my side, but couldn’t find any solution to this…
I know its been quite a while, but for everyone who comes searching for the same problem here is solution. The example I’m demonstrating is for a Pie Chart, but can be easily extended to a bar chart that acccepts the optional dimension (on the top right corner).
Lets say you have a object (Severity) with values : CRITICAL, WARNING, OK, INFORMATION.
You want Red for CRITICAL
Yellow for WARNING
Green for OK
Blue for INFORMATION
The trick is to ensure that your database will always have all these values. If not create an extra dimension table with just these few rows.
Note the order in which the values (Critical, Ok, Warning, Information) is being displayed in the report. Apply your custom sorting if needed.
Now edit the palette of the chart and create a new custom palette.
Put in the colours in the exact order in which your dimension is sorted.
Eg. If Critical is first then the first colour should be Red, Ok is second then the second colour should be green etc.
In case you use a prompt to select and filter out only few severities, create a second query with the same object without a filter, In your report merge these dimensions (both the severity objects) and put it on the chart. This way the palette will always have all the values of the severities and the colours won’t go for a toss even if a particular severity is missing.