Adding colors

Depending on the type of chart you created, Tableau may or may not color code any data. Using the Color box in the Marks pane, however, you could easily add colors to your graphs.

Getting ready

Let's use the sample file Sample – Superstore Sales (Excel). Open a new worksheet and select Sample – Superstore Sales (Excel) as the data source.

How to do it...

Once the data is loaded on the worksheet, perform the following steps to add colors to encode the data:

  1. Drag-and-drop Profit from Measures into the Columns shelf.
  2. Drag-and-drop Sub-Category from Dimensions into the Rows shelf.
  3. To see the Profit values by Ship Mode, drag-and-drop Ship Mode in the Color box in the Marks pane to generate a chart shown in the following screenshot:
    How to do it...
  4. To see the Profit values by Customer Segment, drag-and-drop Customer Segment in the Color box in the Marks pane.
  5. To compare Profit and Shipping Cost values, drag-and-drop Shipping Cost in the Color box in the Marks pane to generate a chart shown in the following screenshot. You can see that tables generated a loss and had the highest shipping costs, whereas chairs and chair mats were profitable, though this category incurred the second-highest shipping costs:
    How to do it...

How it works...

When you drag a dimension to the Color box, Tableau automatically selects a color palette to draw colors from, and these colors are very distinctive and use different hues. When you drag a measure to the Color box, however, Tableau selects a gradient of a single color, and bigger data points (larger values) are encoded by a darker gradient, and smaller data points (smaller values) are encoded by a lighter gradient. It is important to note, however, that the underlying value of the dimension or measure also dictates what type of color palette would be chosen: a dimension of a continuous type of data can generate a gradient palette, and a discrete measure can generate a discrete color palette.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset