Assigning colors to categorical or continuous data
When you configure coloring for a visualization, the first step is to choose which column to color by, and then you can choose how the colors should be assigned to the values in that column. For example, you can determine whether you want the items in your visualization to get distinct colors representing different categories, or if you want to see a gradient color transition between two or more anchor points in a range of values.
About this task
The examples below show the Color by section of the visualization properties panel. In the Colors/Color section of the visualization properties dialog in the installed client/web client respectively, the available options are slightly different.
Categories
When the selected column is in categorical axis mode, for example containing string values, the colors are always applied as categories, where each value in the column gets a separate color, as seen in the image below.
Unique values
For columns in continuous axis mode, you can select the option Unique values, which is similar to the categorical coloring that is available for columns in categorical axis mode. Each unique value in the column gets a separate color, as seen in the example below.
Gradient
For columns in continuous axis mode, Gradient coloring is also available. The items in the visualization will show a color gradient between two or more anchor points, as seen in the example below.
The scatter plot above is colored by the column Sales, and the color range has three anchor points: Min, Average, and Max. You can see the anchor points both in the legend and in the visualization properties to the right.
Segments
Another option for columns in continuous axis mode is Segments. This will color the items representing values between two or more anchor points in fixed colors, as seen in the example below.
The scatter plot above is colored by the column Sales, and in this case the color range has four anchor points: Min, Average, 30, and Max. The colors between these points are set to blue, red, and yellow respectively. This means that items representing values between the Min value (8) and the average value (18) are colored blue, items representing values between average and 30 are colored red, and items representing values greater than 30 are colored yellow. An anchor point will get its color from the segment above it on the scale. In the example above, this means that an item representing the value 30 will be yellow.
Anchor points
When you have colored the visualization using Gradient or Segments, you can add anchor points to the color range, where you want the gradient or segment to switch to another color, by clicking Add point. To specify the exact placement of the added anchor point, you can write an expression or enter an absolute value, or select one of the suggested expressions from the menu to the right on the anchor point,
or
, depending on where you
open the visualization properties. For details on the menu options, see
Available options in the Value/Point menu.