KNOWLEDGE BASE

How To Create Color Gradation Slider Sync With Mouse Hover On Map


Published: 25 Aug 2021
Last Modified Date: 30 Aug 2021

Question

How t create a slider that sync with a mouse hovers action on the color gradation legend.
User-added image

Environment

  • Tableau Desktop

Answer

The following steps are demonstrated in the attached workbook using Sample - Superstore.
  1. Create a new sheet named Map and place fields as below.
  • Columns: Longitude (generated)
  • Rows: Latitude (generated)
  • Colors: Sales
  • Details: Country/Region, State
  1. Right-click State > Create > Parameter.
  2. Add All at the end of the list of values then click save.
  3. Click Analysis > Create Calculated Field and name Mark with the following formula.
    	IF [State Parameter]=[State] THEN [Sales] 
    	ELSEIF [State Parameter]="All" THEN 0
    	END
    
  4. Place Sales in columns and colors.
  5. Place Country/Region and State to details.
  6. Click Analysis > Stack Marks > Off.
  7. Place Marks to columns and remove Sales, Country/Region, and State from the SUM(Mark) pane.
  8. Right-click Mark on columns > Dual Axis.
  9. Change the mark type of SUM(Sales) to Bar and SUM(Mark) to Circle.
  10. Right-click a horizontal axis > Syncronized Axis.
  11. Right-click a horizontal axis > Edit Axis and select Fixed for the range setting. Apply the same range setting to the other horizontal axis.
  12. Right-click Sales on columns and click Show Header to hide the headers.
  13. Create a new dashboard, place the Map sheet and the Color Legend sheet.
  14. Click Dashboard > Actions, then click Add Action > Change Prameter.
  15. Set the parameter action as below, then click OK.
  • Source Sheet: Map
  • Run action on: Hover
  • Parameter: State Parameter
  • Field: State
  • Aggregation: Minimum
  • Clearing the selection will: Set Value to All
Did this article resolve the issue?