1

Creating Labels on Highlighted Marks – datavis.blog

 2 years ago
source link: https://datavis.blog/2022/01/18/creating-labels-on-highlighted-marks/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Creating Labels on Highlighted Marks

Tableau highlight actions allow you to focus your audience’s attention on specific marks in your chart by colouring those marks and dimming other ones in the view.

When combined with labels that only show for highlighted marks, it can create an insightful user experience while also keeping the user interface uncluttered. 

The below visualisation on unemployment rates in OECD countries, created for the #B2VB community project, contains a lot of marks – almost 18,000 – so labelling all marks was obviously not an option. 

One approach could be to label the min and max values per country. Another would be to label the line ends. Both valid, and, as always, it depends on the goals and purpose of the chart.

Label Highlighted Marks Only

I decided I wanted the chart to be used primarily to show the trends over the years – so no permanent labels – but then allow the interested viewer to be able to hover over any data point and see the exact value for that point and also show the same respective values (for the same gender and month) in all other countries for an easy comparison. 

This can be achieved by adding labels to the chart as normal by putting the measure on the Labels shelf on the marks card, but then also selecting the Highlighted option under the Marks to Label section:

This way, only the marks that have been highlighted will show a label. Next, is to determine which marks are highlighted…

Create Highlight Action

On the dashboard, create a new Highlight action by clicking Add Action from the Dasboard > Actions… dialog:

I want the marks for the same month and gender in all other countries to the one I’m hovering over to be highlighted. Therefore, I select Hover for the Run action on setting and then select the Gender and Month fields in the Selected Fields section:

And that’s it. Below is the result:

Reference Lines for Grid Lines

For a few countries, the unemployment rate goes beyond 30%. However, I didn’t want to show a grid line there as it would interfere with the country titles. Instead I added two reference lines, at 20% and 30% and manually added labels against these in the lower left ‘square’ of the small multiple chart (below). This felt sufficient to inform the audience what these lines mean and removed the extra clutter of labels next to every line. 

Workbook

You can interact with and download the workbook from my Tableau Public profile here.

Thanks for reading.
Marc


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK