Another frequently used chart type is the Line chart, which is primarily used to show trends over a period of time. This chart type helps us focus on the peaks and dips in the values over a period of time.
The line chart in Tableau uses the Line mark type.
To understand this chart type better, let's create a Line chart to show profit for all the months over the last 4 years.
In the recipe for Bar chart, we had Region in the Columns shelf and Sales in the Rows shelf. This is a similar situation where we have Dimension in the Columns shelf and Measure on the Rows shelf.
However, in the preceding recipe, the Dimension that is placed in the Columns shelf is not an ordinary dimension. It is a date field, and in addition to this when we get a measure in the Rows shelf, Tableau will create a line chart.
Further, when we get Order Date in the view, Tableau intelligently aggregates the dates at the highest level possible. For example, if the date field includes multiple years, the default level is year. However, if the date field contains data for just one year but includes multiple months, then the default level is month. In the preceding scenario, the highest level is Year.
We can drill down to the desired level of date by clicking on the plus button on the Date field. Refer to the following image:
Further, a date can be discrete as well as continuous. In the preceding recipe, when clicked on the dropdown of Year(Order Date), we saw that there were two sections that showed the year, quarter, month, and so on. We selected the month from the second section, which was for a continuous month and thus got a continuous line chart. See the following image to understand the difference between a discrete line chart versus a continuous line chart.
In the first chart in the preceding image, we have the years on the top and the months at the bottom. This view creates a small table for each year and hence the line is broken after each year. However, in the second chart, the month is combined with the year to show one data point (notice the x axis). These data points when connected via a line create a continuous line chart.
3.137.212.124