A reference line is simply a line that gets drawn on a chart that represents another measure or point of reference. Reference lines can be useful in providing context to the related chart. For example, a line showing the median will visually show the difference of each mark in the chart relative to the median.
In this recipe, we will show some of the top movie genres from 2007-2011 based on worldwide gross amount and add reference lines to show the average overall and average per year:
To follow this recipe, open B05527_06 – STARTER.twbx
. Use the worksheet called Reference Line, and connect to the HollywoodsMostProfitableStories data source:
Here are the steps to create the bar graph with reference lines:
Reference lines can provide additional context to our visualizations, by adding a visual cue that identifies where a reference is relative to the values we are looking at.
In Tableau, adding a reference line is made easier with the Analytics pane. With a single drag from the Analytics pane, a reference line can be added to a view. Alternatively, the reference line can also be added by right-clicking on an existing axis and choosing Add Reference Line.
In the Edit Reference Line, Band, or Box window, additional settings can be applied, such as scope, fill, and a choice to add the confidence interval. From this window, the type of reference can also be chosen – line, band, distribution, or box plot:
When adding a reference line, it is important to remember that the field you want to use as a reference line must be in the view already. If it is not in the view, and if it is not a parameter, the value must be added first to the Details property in the Marks card before it can be used in the Reference line window.
Using parameters for reference lines also add interactivity to your views. This allows the consumers of your dashboards to try out different values and see the visualization change instantly.
3.144.26.138