Bar-in-bar chart

Another possibility for showing relationships between two values for each category is a bar-in-bar chart. Like the bullet chart, the bar-in-bar chart can show progress toward a goal, but it can also be used to compare any two values. For example, you might compare revenue to a target, or you might compare the revenue for the current year to the previous year:

To create this view, continue in the same workbook and follow these steps:

  1. Navigate to the Year over Year Revenue (Bar-in-Bar) sheet.
  2. Drag and drop Revenue from the Hospital Visits data source onto the horizontal axis in the view (which gives the same results as dropping it onto the Columns shelf).
  3. Drag and drop Department Type onto Rows.
  4. Drag and drop Date of Admit onto Color. We'll discuss dates in more detail in the next section, but you'll notice that Tableau uses the year of the date to give you a stacked bar chart that looks like this:
  1. For a bar-in-bar chart, we do not want the marks to be stacked. To turn off stacking, use the top menu to select Analysis | Stack Marks | Off.
  2. All of the bar segments now begin at 0, but some may be completely overlapped. To see each bar, we'll need to adjust another visual element. In this case, hold down the Ctrl key while dragging the YEAR(Date of Admit) field that is currently on Color in the Marks card to Size.
Holding the Ctrl key while moving a field from one shelf to another creates a copy of the field instead.

After completing the previous step, a size legend should appear. The bars will be sized based on the year and we will be able to see all of the segments that are available, even if they overlap.

  1. We want 2018 to be in front and 2017 to be in the background, so drag and drop 2018 within the Size legend to reorder the values so that 2017 comes after 2018:

  1. Double-click the Color legend to edit the colors so that 2018 is emphasized. An orange or blue for 2018 with a light gray for 2019 would serve this purpose well (though you may find other color combinations you prefer!).

At this point, your view should look like the bar-in-bar chart that was shown at the beginning of this section. You may wish to further enhance the visualization by doing the following:

  • Adding a border to the bars. Accomplish this by clicking the Color shelf and using the Border option.
  • Adjusting the size range to reduce the difference between the large and small extremes. Accomplish this by double-clicking the Size legend (or using the caret dropdown and selecting Edit from the menu).
  • Adjusting the sizing of the view. Accomplish this by hovering over the canvas, just over the bottom border, until the mouse cursor changes to a sizing cursor, and then click and drag to resize the view.
  • Hiding the size legend. You may decide that the size legend does not add anything to this particular view as size was only used to allow overlapping bars to be seen. To hide any legend, use the drop-down arrow on the legend and select Hide Card:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.131.212