cancel
Showing results for 
Search instead for 
Did you mean: 
TriAnthony
Community Team Member
Community Team Member

Overview

Legend items come with colored boxes that represent the data points in the chart. The color of each box matches the bar/column/bubble in the chart, as long as the measure is set to a single color, and not conditional or range. When conditional or range is used, the legend item's box becomes grey (or the palette's default color for Scatter Charts), because the box cannot natively accommodate multiple colors. This plugin solves this limitation by:

  • splitting the box into smaller strips to accommodate multiple colors, for conditional, or
  • creating a gradient of two colors in the box, for range.

Limitations

  • This plugin is only relevant to Bar Charts, Column Charts, and Scatter Charts. Other chart types either do not support conditional/range or have their own version of legends (e.g., Area Map).
  • If there are too many legend items, wider boxes might affect spacing and cause certain items to be cut off. See the Configuration section below for more details.

Installation Instructions

  1. Download and unzip the plugin zip file. Extract the files directly (do not extract into a new folder); the plugin files are already organized within a folder in the zip file.
  2. Upload the multiColorLegendItems folder to the plugins directory on your Sisense server (/opt/sisense/storage/plugins).
  3. Check the Add-ons page in the Admin tab (under Server & Hardware) and make sure the new plugin is listed and enabled.
  4. Modify the config file as needed (this can be done before of after the upload).

Configurations

This plugin comes with a configuration file that can be updated as needed. The four configuration settings in the file are:

  • numberOfColorsForWiderBoxes. If there are too many conditions, the box may be too small to accommodate all colors, so the width may need to be increased. In this case, specify the threshold for the number of colors. For example, a threshold of 5 means the box width will be increased if there are five or more colors assigned to it. Otherwise, the original width will be kept. Note: Wider boxes might affect spacing and cause certain legend items to be cut off if there are too many of them. To work around this, the verticalLayout setting can be set to true. The default value is 5.
  • widthMultiplierForConditional. For wider boxes, specify the multiplier. For example, a multiplier of 1.5 means the new width will be 1.5 times the original width for boxes that have more colors than the numberOfColorsForWiderBoxes threshold. The default value is 1.5.
  • widthMultiplierForGradient. If wider boxes are needed for range as well, specify the multiplier. Otherwise, leave the default value of 1. The original width is generally sufficient for range.
  • verticalLayout. Specify whether legend items should be laid out vertically. This is useful when wider boxes are needed and there are too many legend items to fit correctly horizontally. The default value is false.

Examples

1. Conditional with 4 colors (less than the numberOfColorsForWiderBoxes threshold)

Screenshot - Conditional Less Than 5 Colors.png[ALT Text: A comparison of two column charts labeled "Before" and "After," displaying sales and costs data by sales associates. The "Before" chart shows the "Sales" legend item box in grey despite conditional formatting being applied, while the "After" chart correctly displays the four conditional colors.]

2. Conditional with 11 colors (greater than the numberOfColorsForWiderBoxes threshold, the legend item box width is increased)

Screenshot - Conditional Greater Than Or Equal To 5 Colors.png[ALT Text: A comparison of two scatter charts labeled "Before" and "After," displaying sales and costs data by sales associates. The "Before" chart shows the "Sales" legend item box in blue (the palette's default color) despite conditional formatting being applied, while the "After" chart correctly displays all eleven conditional colors, with a wider box to fit them.]

3. Range Auto (both the min and max colors are auto-selected)

Screenshot - Range Auto.png[ALT Text: A comparison of bar scatter charts labeled "Before" and "After," displaying sales and costs data by sales associates. The "Before" chart shows the "Sales" legend item box in grey despite automatic range (gradient) being applied, while the "After" chart correctly displays a gradient between the automatically selected minimum and maximum colors.]

4. Range Manual with Min Max range type (both the min and max colors are manually selected)

Screenshot - Range Manual - Min Max.png[ALT Text: A comparison of bar scatter charts labeled "Before" and "After," displaying sales and costs data by sales associates. The "Before" chart shows the "Sales" legend item box in grey despite manual range (gradient) with Min/Max mode being applied, while the "After" chart correctly displays a gradient between the user-selected minimum and maximum colors.]

5. Range Manual with Min range type (only the min color is manually selected)

Screenshot - Range Manual - Min.png[ALT Text: A comparison of bar scatter charts labeled "Before" and "After," displaying sales and costs data by sales associates. The "Before" chart shows the "Sales" legend item box in grey despite manual range (gradient) with Min mode being applied, while the "After" chart correctly displays a gradient between the user-selected minimum color and the automatically selected maximum color.]

6. Range Manual with Max range type (only the max color is manually selected)

Screenshot - Range Manual - Max.png[ALT Text: A comparison of bar scatter charts labeled "Before" and "After," displaying sales and costs data by sales associates. The "Before" chart shows the "Sales" legend item box in grey despite manual range (gradient) with Max mode being applied, while the "After" chart correctly displays a gradient between the automatically selected minimum color and the user-selected maximum color.]

Rate this article:
Version history
Last update:
‎03-13-2025 11:29 AM
Updated by: