Example – Multiple Fields on Colour

If you drop one field on Colour and then drop a different field on Colour, the second field replaces the first field. However, depending on the chart type, for example treemaps and bullet graphs, you can put multiple fields on colour. You can use one field to set the hue, and the other to show gradations within that hue.

Follow these steps, using the Sample - Superstore data source, to build a treemap with two fields on Colour.

  1. Drag Category and Sub-Category to Columns.

  2. Drag Sales to Size on the Marks card.

  3. Click Show Me in the toolbar, then select the Treemap chart type.

    Tableau moves all fields to the Marks card, putting SUM(Sales) on both Size and Colour, and Category and Sub-Category on Label:

  4. Click the label icon to the left of Category on the Marks card and select Colour:

    Category replaces SUM(Sales) on Colour. The marks are still sized by the sum of Sales, but now they are coloured by Category:

  5. Click the label icon to the left of Sub-Category on the Marks card and select Colour.

    Tableau uses distinct, categorical colours for the first field, Category, and a range of sequential shades to distinguish values for the second field, Sub-Category:

    The size of the individual rectangles is still determined by Sales, per Category and Sub-Category.

    The two fields on Colour (Category and Sub-Category) are related within a hierarchy, so if you swap their positions on the Marks card, moving Sub-Category to be above Category, the effect is the same as if you had removed Category from the view altogether. The treemap changes to show a uniquely coloured rectangle for each Sub-Category:

    When the two fields on Colour are not related within a hierarchy, you can switch the order of the fields on the Marks card so that the field that was used for categorical colours was used for sequential shades, and vice versa.

    If you aren’t satisfied with the colours that Tableau used, you can change them. To open the Edit Colours dialog, do one of the following:

    • In Tableau Desktop, double-click the colour legend.

    • In Tableau Server or Tableau Cloud, click on the drop-down arrow in the top, right-hand corner of the legend.

  6. Make the view more readable by adding Category, Sub-Category, and Sales to Label. Users can hover to see tooltips for any rectangle that is too small to show text by default.

     

 

Thanks for your feedback!Your feedback has been successfully submitted. Thank you!