Tag Archives: bar charts

Moving the Center Line of a Bar Chart with a Gantt Chart

There are cases where we have bar charts whose centerline is not zero, for example when we’ve indexed a measure to have a base of 100. Here’s an example where the SUM(Sales) for each product Category is indexed to the average sales per Category:

What happens when we want the bars to start at 100 and then go up or down from there, like this?

Read on for how to build this in Tableau! Continue reading

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

[loop category=”wikicontent” tag=”bar-charts,Gantt-Charts,Gantt,bars,labels”]
[field title] – Added [field date]
[content]
[/loop]

Related posts:

    [loop tag=”bar-charts,Gantt-Charts,Gantt,bars,labels” exclude=”this” relation=”and” compare=”not” taxonomy=”category” value=”wikicontent”]

  • [field title-link][field thumbnail-link]

[/loop]

Chart Types

Chart Types

This section covers a whole bunch of chart types that are not part of Show Me, but can be built in Tableau, along with some notes on how to get existing charts to work more like I want them to. There’s also a whole section on the Path Shelf.

Be sure to check out the following sources of material on the Tableau Community:

Multiple mark types on same view:

put multiple measures on same row/column Then choose Dual Axes (synchronize if necessary) Then on the Marks card, click on the upper-right drop-down arrow to choose Multiple Mark Types

Showing Summary and Detail Together | Tableau Software
http://onlinehelp.tableausoftware.com/current/pro/online/en-us/help.htm#multiplemeasures_combocharts.html

Path Shelf

On blood transfusion data, getting a table calc to have connected points for a line chart:

Notes from Mar 2012 WebEx w/Joe Mako

I don’t want to misrepresent Joe’s awesome knowledge here, if there are any mistakes in these notes from our conversation they are almost certainly mine.
In Tableau v7.0, the Tableau DATETRUNC() from the pill menu doesn’t work. 1. Turn Quarter into Continuous field using DATE(DATETRUNC(‘quarter’,[date field])) 2. Set to Exact Date – Continuous 3. Put Month([date field]) on Path Shelf. Note – when on LoD it causes partitioning, when on Path shelf it helps connect marks 3. Then for each measure (axis) select the pill->Format->Hide…Connect Lines

Another comment on PATH shelf

Using  a set to get the path shelf to draw things properly: http://community.tableausoftware.com/message/136628#136628 From Think Data Thursday #4, 9/13/12 Path Shelf needs specific structure of data. In particular, origin/destination need to be in the same column, not separate columns. More on Path shelf From http://community.tableausoftware.com/message/188861#188861 If you’re trying to just get the data together, try these resources: http://kb.tableausoftware.com/articles/knowledgebase/using-path-shelf-pattern-analysis The key bit that is not talked about in that is that if you want to use Tableau’s built-in geocoding to get latitude and longitude, you need to change them to aggregate fields like MIN(State), this forum post has the details: http://community.tableausoftware.com/thread/109399 Finally, I’ve attached a workbook that demonstrates this. point to point mapping.twbx

Putting charts in tooltips:

http://www.tableausoftware.com/community/support/kb/barsintooltips http://www.thedatastudio.co.uk/blog/the-data-studio-blog/andy-cotgreave/charts-in-a-tooltip http://www.tableausoftware.com/about/blog/2010/09/using-bar-charts-tooltips Bullet charts: http://www.freakalytics.com/2011/01/29/enhanced-bullet-charts/ Tableau control charts: http://www.tableausoftware.com/support/knowledge-base/control-charts http://dataremixed.com/2011/10/how-to-make-control-charts-with-tableau/ http://sanpelegrino.tumblr.com/ funky pie charts: http://twitpic.com/72r2jp Treemaps http://www.cs.umd.edu/hcil/treemap/ Box plots: http://www.tableausoftware.com/support/knowledge-base/box-plot-analog

Likert scales:

http://www.datarevelations.com/likert-scales-the-final-word.htmlhttp://www.datarevelations.com/using-tableau-to-visualize-survey-data-part-1.htmlhttp://community.tableausoftware.com/thread/117982 – putting many questions all together to see the spread

More on surveys
http://peltiertech.com/WordPress/charting-survey-results/

Nice post about ordering & annotating data:
http://www.storytellingwithdata.com/2013/09/logic-in-order.html

panel or trellis charts:

http://www.thedatastudio.co.uk/blog/the-data-studio-blog/andy-cotgreave/panel-charts-in-tableau http://www.datarevelations.com/the-likert-question-question.html In Tableau, panel charts really need the X and Y axes to have the same values Joe’s version: http://community.tableausoftware.com/message/181493#181493

http://boraberan.wordpress.com/2013/03/15/trellis-charts-with-tableau-8/

Small Multiples for Tables

http://www.perceptualedge.com/articles/b-eye/tablelens.pdf

Ensuring dual axes are available

Make sure that both fields have the same datatype. One way to check to see what data type Tableau is recognizing a field as is to open the calculated field box, select the desired field and in the yellow box at the bottom right will tell what type of field it is. Note that datatype and number format are independent! See this thread on what can happen when you try mark labels on a dual axis chart without synchronized axes: http://community.tableausoftware.com/thread/114593

Parallel Coordinate Plots

http://public.tableausoftware.com/views/ParallelCoordinatesExample/ParallelCoordinatesExample http://www.tableausoftware.com/support/forum/topic/parallel-coordinates-plot http://www.perceptualedge.com/articles/b-eye/visual_multivariate_analysis.pdf http://www.perceptualedge.com/articles/b-eye/parallel_coordinates.pdf

Combination chart with overlapping bars and line:

Using measure values and unstacking marks to create the overlapping bars, dual axis to create the line. http://vizwiz.blogspot.com/2011/08/tableau-tip-7-easy-steps-to-create.html image[78] calendar view http://www.tableausoftware.com/blog/calendar-data-visualization waterfall charts http://community.tableausoftware.com/thread/107514?start=0&tstart=0 Using Custom Shapes http://community.tableausoftware.com/thread/116844 https://www.interworks.com/blogs/iwbiteam/2012/01/27/using-custom-shapes-tableau cumulative distributions (pareto chart) http://kb.tableausoftware.com/articles/knowledgebase/cumulative-distributions pareto Grouped Bar chart (like what Excel does)

See http://drawingwithnumbers.artisart.org/bars-and-lines/ for a more complete treatment of doing grouped bars and lines.
http://kb.tableausoftware.com/articles/knowledgebase/grouped-bar-chart side by side bars Joe Mako variation on this using Custom SQL that would allow for multiple lines, I think: http://community.tableausoftware.com/message/132454#132454 Also called side by side stacked bars Stem and Leaf plots http://www.datadrivenconsulting.com/2011/04/stem-and-leaf-plots-sorta-in-tableau/ stem and leaf plot Ternary charts http://community.tableausoftware.com/message/179240#179240 ternary plot making more interesting data-rich vizzes: 1.     duplicate a measure (usually as rows) 2. do multiple mark types 3. aggregate or disaggregate the measure as needed 4. turn on dual axis 5. synchronize axes examples – putting sales by customer circles on a bar chart of sales by state putting pie charts on a chloropleth map putting an overall average on a per unit average from TCC11 – JediTricks video Triangle charts http://community.tableausoftware.com/message/178976#178976 triangle plot

More than 2 mark types on same view

Joe Mako hack in Tableau 5 using reshaped data to draw lines as points, bars, and a line http://public.tableausoftware.com/views/BarLineandDot/Example Treemaps Treemaps in Tableau? can be done. Waterfall charts http://www.alansmitheepresents.org/2011/02/waterfall-and-funnel-charts.html

Kaplan-Meier Survival Curves

http://community.tableausoftware.com/message/216551#216551

 

Radial Chart

http://interworks.co.uk/tableau/radial-bar-chart/

[loop category=”wikicontent” tag=”charts,chart-types,bar-charts,Kaplan-Meier,Likert,Likert-scales,Marks-Card,panel-charts,trellis-charts,Path-Shelf,Show-Me,small-multiples,survival-curves,ternary-charts,tooltips,waterfall-charts”]
[field title] – Added [field date]
[content]
[/loop]

Related posts:

    [loop tag=”charts,chart-types,bar-charts,Kaplan-Meier,Likert,Likert-scales,Marks-Card,panel-charts,trellis-charts,Path-Shelf,Show-Me,small-multiples,survival-curves,ternary-charts,tooltips,waterfall-charts” exclude=”this” relation=”and” compare=”not” taxonomy=”category” value=”wikicontent”]

  • [field title-link][field thumbnail-link]

[/loop]

Stacked Bars and Lines

Bars and Lines

This is a post about getting the output you want, despite what Tableau thinks.
This is a post about making Tableau do what Excel can do (whether it’s a good idea or not).
This is a post about gaining better understanding of dimensions, measures, continuous, and discrete.
This is a post about putting bars and lines on the same chart. Continue reading