Skip to main content

브라우저 창 크기가 너무 작습니다.

대화형 학습을 계속할 수 있도록 브라우저 창 크기를 다시 조정하세요. 너비는 최소 900픽셀로 조정하는 것이 좋습니다.

Learning Objectives

After completing this unit, you’ll be able to:

  • Create and analyze a bar chart.
  • Format a bar chart to improve readability and facilitate comparison.
  • Create and analyze a stacked bar chart.

Connect Your Tableau Public Account

To get started, connect to your Tableau Public account in the Playground window to the right. If you don’t have a Tableau Public account, sign up and activate it before starting this interactive unit. If you need more detailed instructions, check out Data Storytelling with Tableau Public.

Note

The playground resets if your Tableau Public login session expires or if you refresh the page before completing the unit. We recommend completing this unit in one sitting.

Scenario

Now that you’ve learned about bar charts, you're ready to build one while applying best practices.

The Coffee Chain sales department needs a visual representation of sales by product, so Jamal decides to create a bar chart. Follow along with the steps here. Remember, you can use Undo in the toolbar undo icon shown as a left-facing arrow if you make a mistake.

Questions for Analysis: Compare Product Sales

  • Which are Coffee Chain’s top-selling products?
  • Which are the lower performers?

Build a bar chart to find out.

Build a Basic Bar Chart

  1. Drag Coffee Chain Sales to the Rows shelf.
    Now you can see the total sales. But you want to compare the sales of products to one another.
  2. From under Product Hierarchy, drag Product to the Columns shelf.

That was easy. You now have a basic bar chart to compare sales by product.

You can already see that Colombian was the top-selling product. It looks like Amaretto and Regular Espresso are both lower performers, but it's hard to determine which is the lowest. And the lengthier product names are harder to read.

Apply Best Practices and Add More Information

Put the products along the left-hand side so the names are easier to read.

  1. Swap rows and columns using the toolbar icon.double-ended arrow pointing from top left and lower right and vice versa

And then sort the bars to make the comparison of products easier.

  1. Sort the bars descending using the toolbar or sales axis icon. down arrow with bars sorted by length from longest to shortest

Now you can see that Regular Espresso is the lowest-selling product. Your bar chart can now easily answer our first set of analysis questions.

Jamal knows that Coffee Chain segments these products into different product types. What could you do if you wanted to see how these products perform against other products within these product types?

  1. Drag Product Type to the left of Product on the Rows shelf.

Nice work. You've created a bar chart that compares sales by product divided into panes for each product type.

The top half of your viz should look something like this.

Part of a horizontal bar chart showing Coffee Chain Sales by Product Type and Product

Answer Questions Using Your Bar Chart

If you hover over any of the bars, you see a tooltip with the exact sales numbers for each product. Jamal hears that Coffee Chain is particularly interested in sales of herbal tea.

You can use your bar chart to answer questions about herbal tea, such as:

  • Which is the highest-selling herbal tea and how much did it make?
  • Which is the lowest-selling herbal tea and how much did it make?

It’s best practice to name your worksheets meaningfully to match your analysis.

  1. Double-click the tab for Sheet 1 at the bottom of the screen. There are alternative ways to perform many actions in Tableau. You can also right-click | Rename.
  2. Rename the sheet Sales by Product, then press Enter to save the change.

Build a Stacked Bar Chart (Optional)

What if you want to explore how product sales in the different Coffee Chain markets are performing against one another? And how do ‌sales for each of the product types contribute to the overall value of sales for each market? This last question is a part-to-whole question that you can answer by building a stacked bar chart. Note that this challenge is an opportunity for you to create a stacked bar chart but won't be checked.

As a start, you can quickly build another bar chart.

  1. Create a new sheet by selecting the New Sheet icon icon with a chart and a plus sign next to the sheet tab Sales by Product.
  2. Build a horizontal bar chart with Coffee Chain Sales on Columns and Market (from under Location) on Rows.

How can you see how each of the product types are performing in each of those markets?

  1. Drag Product Type to Color on the Marks card.

Apply Best Practices to Your Stacked Bar Chart

To see the exact contribution each product type makes to sales within a market, use mark labels.

  1. Select Label on the Marks card and then select Show Mark Labels.
  2. Rename the sheet Sales by Market and Product Type, then press Enter to save the change.

The top half of your chart should look something like this.

Part of a stacked bar chart showing Coffee Chain Sales by Market with sales numbers for Product Types shown in color within each bar

Nice work. You've created a stacked bar chart that compares sales measures by market while also showing how product types contribute to the overall value of sales for each market.

Answer Questions Using Your Stacked Bar Chart

Use your viz to answer these questions:

  • Do any product types stand out as outsized contributors to market sales?
  • Which market doesn't have any sales for tea products?

Jamal observes that there are no product types with an outsized contribution to market sales and wonders about the data for tea products in the southern market. Maybe Coffee Chain hasn't started selling tea products in all of the markets yet. These insights would be great to share with the Coffee Chain stakeholders to confirm this data set is complete and that everything represented here tells the full picture of what's happening in that market.

Publish Your Viz (Optional)

To save your workbook for more analysis later, publish it to‌ Tableau Public.

  1. From the area above the toolbar or from the File menu, select Publish As.
  2. On the Publish Workbook dialog, enter a name for your viz, for example, Coffee Chain Bar Chart.
  3. Select Publish.

Note:

Select the first sheet containing your bar chart before checking the challenge.

Resources