KNOWLEDGE BASE

How To Color The Bin For A Selected Item In A Histogram Graph


Published: 20 Jul 2020
Last Modified Date: 20 Jul 2020

Question

How to color the bin for a selected item in a histogram graph?

Environment

  • Tableau Desktop

Answer

1. Open Tableau Desktop and connect to Sample - Superstore
2. Right click Quantity Select Create > Bins
3. Edit Size of bins to 1, click OK
4. Drag Quantity(bin) to Columns
5. Drag Order ID to Rows while right clicking the mouse, select CNTD(Order ID)
6. Create a parameter Select an Order ID
7. Change the Data type to String, Allowable values to List, Add from Field > Order ID
8. Create a calculation field Color the bin like the following
COUNTD(if [Order ID]=[Select an Order ID]
then [Order ID]
END)
9. Drag Color the bin to Color
10. Edit the color to the colors you like.
 
Did this article resolve the issue?