Tag Archives: labels

Feature Geek: Coloring Labels with Mark Colors in Tableau 9.2

This is the second in a series on new features in Tableau 9.2, if you’re really into this I’ll be doing a training on Tableau 9.2 a few weeks after the software is released, more information below!

A new feature in Tableau 9.2 is to make label colors similar to mark colors. Here’s the old way:

non-colored label

And the new:

colored labels

To turn this on, check “Match Mark Color” in the Label Shelf->Font options:

Screen Shot 2015-11-30 at 2.18.11 PM

In the scatterplot view above the mark colors and labels pretty much look like they match, but they aren’t quite exact. For legibility Tableau is applying an algorithm to alter the label color based on where the label is in relation to the mark. Here are some additional charts, notice how the Darjeeling label is a lighter green on a white background and a darker green when it’s over the light green Darjeeling mark:

four mark types

The algorithm isn’t perfect, Chamomile & Decaf Irish Cream in particular are too light on the Area chart, there’s a bug with transparency and Area marks in the beta, and this is essentially v1.0 of this new feature so we can look forward to some improvements over time.

What’s it good for?

I regularly have line charts where there are a few reporting units with the group performance, this will help users make the connection between the labels and the lines.

Here’s the coloring labels workbook on Tableau Public so you can see it out for yourself, and download if you have the 9.2 beta (if you want it check with your Tableau sales rep).

What’s New in Tableau 9.2?

Roughly two weeks after the public release of Tableau 9.2 I’ll be doing an online training on all the new features in Tableau 9.2 Desktop – this post is a sample of what you’ll be seeing in the course, a combination of how the feature works, where the edges are and how you might use it. Sign up below to get more info when the course is available!

Let me know about the Tableau 9.2 New Features training with Jonathan Drummey and DataBlick

Formatting Bar Charts and Gantt Charts

Much of this will change with Tableau v8.

Andy Cotgreave at the Data Studio w/lots of cool options:
http://www.thedatastudio.co.uk/blog/text-label-beyond-default

Putting text at the left/bottom of bars (by creating another header)
http://public.tableausoftware.com/views/Text-labelledbars/Horizontal
http://public.tableausoftware.com/views/Text-labelledbars/Vertical

Putting text at left/bottom of bars (by creating a dual axis w/ a zero field)
http://public.tableausoftware.com/views/TextLabelsInsideBars/InsideBarHorizontal
http://public.tableausoftware.com/views/TextLabelsInsideBars/OutsideBarVertical
http://public.tableausoftware.com/views/TextLabelsInsideBars/InsideBarVertical

Putting text in center of bars
Option 1 – make it a Gantt Bar (see conditional formatting)
Option 2 – Joe Mako’s hack From http://community.tableausoftware.com/message/184379#184379
See scoreboard for forum jm edit.twbx

Stacked bar charts can put the mark labels in the middle of the bars, so we can use Measure Values with the measure of interest and a measure that returns Null to create the stacked bars. The Null measure won’t show anything, while the measure’s label will be in the proper location.

The measure that returns Null needs a formula like IF 1=0 THEN 0 END, if just Null is used then Tableau forces that to be a True/False dimension, and that won’t work.

Measure Names must be in the level of detail of the view (LoD Shelf, Colors Shelf, etc.) on the Level of Detail Shelf for this to work, that’s part of what forces Tableau to properly stack the bars.

Bar Chart

length of bars is whatever is on columns or rows shelf (stacked or unstacked) Size shelf determines thickness of bars size slider adjusts thickness mark label is pinned to the end of the bar

Gantt Bar chart

starting position of bars is whatever is on columns or rows shelf Size shelf determines length of bars Size slider changes thickness mark labels can be set to beginning, middle, or end of bar Note in Tableau v6.1 the mark label alignment has only one value for all measures with Gantt Bar marks on the same chart. In Tableau v7, the mark label alignment can vary for each measure.

controlling thickness in Gantt bars – some ideas
http://community.tableausoftware.com/thread/112438

one thought is to use a line chart (w/path shelf) to draw lots of lines where the gantt bars would be, and that would enable control of the line thickness as well as length

Couple of options for BYO Gantt Bars

http://community.tableausoftware.com/message/180913#180913
workbooks are (Joe’s uses Custom SQL to duplicate data sources):
Gantt Graph – Margin Walk Viz jtd edit.twbx
Gantt Graph – Margin Walk Viz jm edit.twbx

Related posts:

  • Feature Geek: Coloring Labels with Mark Colors in Tableau 9.2
  • Chart Types
  • Bars and LinesStacked Bars and Lines