Building Line Charts

Line charts connect individual data points in a data view. They provide a simple way to visualize a sequence of values, and are especially useful when you want to see trends over time, or to forecast future values. For more information about the line mark type, see Line Mark.
The following exercise walks you through creating a view that displays the sum of the sales and the sum of the profit for all years and then uses forecasting to determine a trend.
  1. Connect to the Sample - Superstore - English (Extract) data source, which is included with Tableau Desktop.
  2. Drag the Order Date dimension to Columns.
    The date is automatically aggregated by year, and column headers are created.
  3. Drag the Sales measure to Rows.
    Tableau automatically aggregates Sales as SUM, and displays a simple line chart.
  4. Drag the Profit measure to Rows, and drop it to the right of the Sales measure.
    Tableau creates separate axes along the left margin for Sales and Profit:

    Notice that the scale of the two axes is different—the Sales axis scales from $0 to $10,000,000, whereas the Profit axis scales from $0 to $2,500,000. This can make it hard to see that sales values are much greater than profit values. When you are displaying multiple measures in a line chart, you can align or merge axes to make it easier for users to compare values. Use Dual Axes to align the axes or use Blended Axes to enforce a single axis across multiple measures.
    With either of these options, you can create a combination chart to change the mark type for one of your measures. See Combination Charts.
  5. Drag the SUM(Profit) field from Rows to the Sales axis to create a blended axis. The two pale green parallel bars (shown in the red box) indicate that Profit and Sales will use a blended axis when you release the mouse button:

    The view updates to look like this:

    The view is rather sparse, because we are looking at a summation of values on a per-year basis.
  6. Click the Year(Order Date) field in the view and select Month in the lower part of the content menu (see image below). This tells Tableau that you want to look at a continuous range of values over the four-year period:

    The resulting view is a lot more detailed than the original view:

    Notice that the values seem to go much higher just before the end of each year. A pattern like that is known as seasonality. If we turn on the forecasting feature in the view, we can see whether we should expect that apparent seasonal trend continuing into the future.
  7. Right-click in the view and choose Forecast >Show Forecast. We then see that, according to Tableau forecasting, the seasonal trend does continue into the future:


No comments:

Post a Comment