How to make a slope graph in a table?

Preparation time : 15 minutes

Level : Intermediate

Objective: Make a slope chart

In this article, we are going to explore together how to build a graph by Slope interactive and impactful in Tableau Desktop. This type of dynamic visualization makes it possible to compare developments over several periods and highlight key trends. By following these steps, you will not only learn how to build such a graph but also how to refine your chart to improve its readability and make your insights clearer.

Required data

  • 1 data table, Hypermarket (at the bottom of the Tableau Desktop login page),
  • 1 measure, for example Sales,
  • 1 dimension, such as Sub-Category.

Step 1: Preparing the data

  1. Create a parameter and enter the following information:
    1. Name : “Select a sub-category”,
    2. Type : Chain,
    3. List : Sub-Category field values,
  2. Click on OK,
  3. Create a calculated field and Name it : “Parameter - Sub-category”,
  4. Enter the formula:”[Sub-category] = [Select a sub-category]
  5. Click on OK,
  6. Create a new calculated field and Name-the “Label - Sales/sub-category”,
  7. Enter the formula:”IF [Parameter - Sub-category] THEN [Sales] END”,
  8. Click on OK.

Step 2: Construction of the slope graph

  1. Swipe the field Order date In the Columns,
  2. Swipe the field sales In the Lines,
  3. Duplicate The field sales In the Lines,
  4. Build a double axis and Synchronize the axes.

Step 3: Refine the chart

  1. Swipe the field Parameter - Sub-category in the tabs colour And the field Sub-category in the tab Details Of the landmark Everything,
  2. Change the type of the first coordinate system SUM (Sales) to Shapes,
  3. In the same frame of reference, drag:
    1. The field Parameter - Sub-category in the tabs Size and Shape,
    2. The field Tag - Sales/subcategory in the tab Label,
  4. Change the settings of the landmark in the following manner:
    1. Shapes : put a full circle for True and False values,
    2. colour : Put a bright color for True values and a gray color for False values,
    3. Size : Adjust the size of the True values via the form on the right side of the screen,
  5. Refine the view according to your preferences.

Advice

Here are a few tips for perfecting your chart and optimizing its visual impact:

  • Add a parameter to adjust the scale of your dimension to adapt the granularity of your analysis. For the example in this article, we could build a parameter on the Order Date field that would allow the user to choose the granularity year, month, or day.
  • For a more intuitive reading, keep the color code subtle by using a brighter hue for values True And a gray for values False.
  • Remove the gridlines in the background to visually lighten the view and make your chart more readable.