If we configure a Graph Portlet to use the 'Consistent Colors' option, can we 'map' the datapoint value to a specific color?

Document ID : KB000027096
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

If we configure a Graph Portlet to use the 'Consistent Colors' option can we 'map' the datapoint value to a specific color?

Solution:

No. The use of consistent colors is not designed to 'map' the datapoint value to a specific color. The functionality of the consistent colors uses a hash algorithm to determine or 'grab' a color for the values in the color key used on the graph. The use of 'consistent colors' is intended to be used if you want the same color for the same value across all portlet graphs so that the end user can easily identify the color with the value from one graph to the other graph. You cannot 'map' a specific color with a specific color key value. For example if you have four values within the color key, and you use consistent colors mode, the application will use the hash algorithm to determine which colors to select for each of the four values. For example, if you have 4 values in your color key such as 'Open', 'Closed', 'Work in Progress', 'Client to Callback'. The use of consistent colors "may" pick the following colors (it may be different on your implementation)

Yellow = Open
Brown = Work in Progress
Red = Client to Callback
Purple = Closed

(the data is sorted the same on both graphs using a data sort key)

Graph 1 - with consistent colors mode selected:
Value in Position 1 = Work in Progress / color shown will be Brown
Value in Position 2 = Closed / color shown will be Purple

Graph 2 - with consistent colors mode selected:
Value in Position 1 = Open / color shown will be Yellow
Value in Position 2 = Client to Callback / color shown will be Red
Value in Position 3 = Closed / color shown will be Purple

If you were to use the 'default colors' mode and you were to compare graph 1 and graph 2 the colors will appear in the order defined for the color palette (or the system defined color order) for each graph and the color would not be the same for the value in the color key because you may not have data points for each value in the color key. If you want to be sure of the order in which the colors appear on the graph, use the 'default colors' mode. This will use the system colors if no palette is defined, or it will use the order of the color palette. The colors are not 'mapped' to specific values that appear in the graph.
For example, if you have a color palette defined with the following colors in the listed order you will see your graphs as described below:

Color Palette Order
1-Bright Blue
2-Orange
3-Dark Green
4-Dark Red

Graph 1 - with default colors mode selected:
Value in Position 1 = Work in Progress / color shown will be Bright Blue
Value in Position 2 = Closed / color shown will be Orange

Graph 1 - with default colors mode selected:
Value in Position 1 = Open / color shown will be Bright Blue
Value in Position 2 = Client to Callback / color shown will be Orange
Value in Position 3 = Closed / color shown will be Dark Green

Configuration Recommendation: Configure your portlet, to use the default colors mode. Then when two portlets appear on the same page, the end-user can easily switch both portlets to the 'Consistent Colors' mode through the [--Actions--] pull-down on each portlet.