A trend line is a bounded line that tracks movement in a measure over a period of time. Adding trend lines to a continuous chart helps understand and explain the chart better. It helps to identify an existing pattern, the slope of the growth, and acts as a support of the future predictions. In this guide, you will learn how to add trend lines to continuous charts in Tableau.
We will be using the sample superstore data source available in the Tableau repository. The variables to be used are Order Date
and Profit
, respectively.
Order Date
variable to the Columns shelf.Output:
Output:
Next, we select at what date aggregation level we want the filter to happen. We are interested in analyzing the monthly trend for the year 2019, so we will select it and click on Ok.
Output:
Completing the above steps will create the following output.
Output:
Order Date
variable, which will generate the pop-up below. Output:
Output:
Completing the steps above will produce the following chart.
Output:
Profit
variable to the Rows shelf. This generates a continuous line chart showing monthly profit for the year 2019.Output:
Output:
Output:
Selecting the Linear model option from the previous step will generate the following output.
Output:
Segment
into the Color property of the Marks shelf. This will generate the trend line for each segment during the given time frame, as is shown below. Output:
Output:
Completing the above step will create a pop-up window with options for editing the trend line. We can select these options depending on what we want to accomplish.
Output:
Output:
Output:
Output:
Output:
In this guide, you learned how to create a continuous chart and add a trend line to it. You also learned the different options available in Tableau to enrich the trend line with deeper statistical insights. This will help you decide which options to select depending upon the type of data you have and the analysis you want to perform.
To learn more about visualization and data analysis using Tableau, please refer to the following guides: