Value based color coding in bar graph or pie chart

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.


Prashant Purohit :india: (BOB member since 2009-02-18)

Welcome to B:mrgreen:B
Try for creating alerters on a simple table and then convert it into Bar graph…


aniketp :uk: (BOB member since 2007-10-05)

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?


Prashant Purohit :india: (BOB member since 2009-02-18)

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… :slight_smile: . 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… :frowning:

Also I tried from my side, but couldn’t find any solution to this…


aniketp :uk: (BOB member since 2007-10-05)

thanks for your effort, actually me too working on WebI from around 2 years but didn’t join this forum before because never got stuck in this way…:slight_smile:


Prashant Purohit :india: (BOB member since 2009-02-18)

I think the best place to get the ideas for BO issues is this only. There is no other forum which is fruitful like this is… :slight_smile:


aniketp :uk: (BOB member since 2007-10-05)

You are right aniket, it’s necessary to share ideas, I never used any forum before but hope to be active member of this forum.

Warm Regards,

Prashant


Prashant Purohit :india: (BOB member since 2009-02-18)

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

  1. 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.
  2. Note the order in which the values (Critical, Ok, Warning, Information) is being displayed in the report. Apply your custom sorting if needed.
  3. Now edit the palette of the chart and create a new custom palette.
  4. 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.


Karan Gupta :india: (BOB member since 2010-04-06)

Hey thanks, I also did the same thing to resolve this issue. 8)


Prashant Purohit :india: (BOB member since 2009-02-18)

Sorry for being slow to grasp concept. But I don’t understand how to:

  1. create an extra dimension table with just these few rows.
  2. merge the dimensions.
  3. put it on the chart.

tcison (BOB member since 2012-10-10)