IBM Support

How to Create a Legend for a Custom Palette in Cognos Analytics?

Question & Answer


Question

A chart with a custom palette is created within Cognos Analytics Report Authoring. After doing so, the legend of the chart show two sets of colours, and only the customised one is displayed. How do I hide the default legend and keep only the legend for my custom palette?

Answer

In order to display the same colours for both the chart and the legend, create your own legend using a repeater table and conditional styles.

The steps below provide a general guide however some object properties, such as border style and box padding, may need to be modified depending on the existing report layout to meet presentation requirements.


1. Select the default legend on the chart from the page structure view ( ) and delete it.
2. From the toolbar, drag in a new table with one row and two columns
3. From the page design view, move the chart into the first cell.
4. From the toolbar, drag a repeater table to the second cell.
5. From the toolbar, drag a text item into the repeater table with a single space entered as text.
6. From the data items tab, drag the data item on which the conditional palette is applied to the left of the single space form the previous step.
7. Select the text item, then select Conditional Styles from the right-hand properties pane.
8. Click New Conditional Styles then select Advanced Conditional Style.
9. Create new conditions which mirror your conditional palette conditions.
10. Click the Edit Pencil on each new condition and change the background colour to the associated colour in your conditional palette.
11. Hit OK on the Conditional Styles windows to close them.

In this example, a table was used to space the chart and legend appropriately but other implementations, such as blocks, may be more appropriate depending on the the specific report design requirements. The repeater table and conditional styles are used in combination to implement the actual legend.

[{"Product":{"code":"SSTSF6","label":"IBM Cognos Analytics"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Report Authoring v11x","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"11.0","Edition":"All Editions","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
15 June 2018

UID

swg22000227