COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Stephaneky on 07 Jan 2018 06:24:28 PM

Title: Report studio conditional style bar chart with defined colors
Post by: Stephaneky on 07 Jan 2018 06:24:28 PM
I am trying to generate a report that includes a stacked bar chart where the customer is requesting specific colors for each product. Assume that each bar represents a month (or time period) and each section of each bar represents a product i.e. product a / product b / product c etc..... for each bar. The requirement is to have each product in a specific color. If I use the standard palette, the color for each product is selected sequentially. I need to define the color for each product myself i.e. product a should always be blue, product b should always be green, etc.....so that there is a consistent color representation across multiple charts/ reports regardless of number of products.
Any help would be greatly appreciated!
Title: Re: Report studio conditional style bar chart with defined colors
Post by: hespora on 08 Jan 2018 02:48:54 AM
by using an outer join or a union, make sure your dataset always have values for each dimension intersection.
In your example, the left hand side is missing data for the "DIA" dimension. If you make sure the data is there with a zero value, you'll solve the problem.
Title: Re: Report studio conditional style bar chart with defined colors
Post by: Stephaneky on 08 Jan 2018 06:24:26 AM
Thank you hespora,

However; does that mean that I need to display every single dimension on every chart even though it will have 0 value? I am trying to avoid that because in some cases I have many dimensions and I do not want to use real estate and display 0 value dimensions. Is there a way to use conditional logic to assign color to dimension?


Title: Re: Report studio conditional style bar chart with defined colors
Post by: hespora on 08 Jan 2018 06:53:47 AM
In report studio, select the series of your chart (click on the little symbol on the left hand side of the "series" box). Now, you have access to a property "conditional palette" (left hand side under properties) where you can build palette entries for specific values.

The downsides to this approach are a) you're going to have to manually do this for every chart you are using. Filling in the blank values would solve it for all charts at once, but I get why real estate might become a problem; b) if your dimension from one day to the next includes values that you did not account for, you're going to have to update the report.
Title: Re: Report studio conditional style bar chart with defined colors
Post by: Stephaneky on 08 Jan 2018 07:23:03 AM
I really appreciate your assistance hespora.

I think unfortunately that the second solution is the most appropriate in my case even though I agree that there are drawbacks as you mentioned. The only issue I found with this method is that I can use the conditional palette, but for some reason I am unable to "de-select" the standard palette and therefore the legend keeps using the default colors.