Skip to main content Skip to complementary content

Line chart

The line chart is used to show trends over time. The dimension is always on the x-axis, and the measures are always on the y-axis.

Line chart.

Your data set must consist of at least two data points to draw a line. A data set with a single value is displayed as a point. You can fill in the space beneath the lines by using an area line chart visualization.

If you have a data set where data is missing for a certain month, you have the following options for showing the missing values:

  • As gaps
  • As connections
  • As zeros

When a month is not present at all in the data source, it is also excluded from the presentation.

When to use it

The line chart is primarily suitable when you want to visualize trends and movements over time, where the dimension values are evenly spaced, such as months, quarters, or fiscal years.

Advantages

The line chart is easy to understand and gives an instant perception of trends.

Disadvantages

Using more than a few lines in a line chart makes the line chart cluttered and hard to interpret. For this reason, avoid using more than two or three measures.

Showing or hiding dimensions and measures depending on a condition

You can show or hide a dimension or measure depending on if a condition is true or false. This is known as a show condition, and is entered as an expression. The dimension or measure is only shown if the expression is evaluated as true. If this field is empty, the dimension or measure is always shown. Expand the dimension or measure in the Data section of the properties panel and enter an expression under Show dimension if or Show measure if.

Information noteCustom tooltips are disabled for a line chart if any of the dimensions in the chart are using a show condition.
Information noteTime series forecasting is not available if any of the dimensions or measures in the line chart use a show condition.

Let's say you have a dataset with the fields Sales, Quarter, Year, and Order Number, among others. You could configure your chart so that sales are displayed along a time-based dimension for yearly aggregations. You can add a second dimension for quarterly aggregations but only organize the data by this dimension if the total number of orders received by your company has reached a target goal of 100,000.

  1. In edit mode, turn on the advanced options.

  2. Drag a line chart from the assets panel onto the sheet.

  3. Add Quarter as a dimension.

  4. Add Year as a second dimension from the properties panel.

    Each distinct year in the data model becomes a separate line in the chart.

  5. Add Sum(Sales) as a measure.

  6. In the properties panel, expand the dimension Manager. Under Show dimension if, add the following expression:

    Count([Order Number])>100000

If your data contains 50,000 order records, the chart will not organize sales by quarter, since the expression is evaluated as false. If the data contains 100,000 or more order records, sales will be organized by both Year and Quarter.

Display limitations

Displaying large numbers of dimension values

When the number of dimension values exceeds the width of the visualization, a mini chart with a scroll bar is displayed. You can scroll by using the scroll bar in the mini chart, or, depending on your device, by using the scroll wheel or by swiping with two fingers. When a large number of values are used, the mini chart no longer displays all the values. Instead, a condensed version of the mini chart (with the items in gray) displays an overview of the values, but the very low and the very high values are still visible.  Note that for line charts with two dimensions, the mini chart is only available in stacked area mode.

Line chart with a mini chart, since the dimension values exceeds the width of the visualization.

Line chart with mini chart.

Displaying out of range values

In the advanced edit mode properties panel, under Appearance, you can set a limit for the measure axis range. Without a limit, the range is automatically set to include the highest positive and lowest negative value, but if you set a limit you may have values that exceed that limit. When a data point value cannot be displayed, due to the range limits, an arrow indicates the direction of the value.

When a reference line is out of range, an arrow is displayed together with the number of reference lines that are out of range.

Displaying large amounts of data in a line chart

If the chart uses a continuous scale, you can set the maximum number of visible points and lines in advanced edit mode. In the properties panel, go to Presentation. Then adjust the following:

  • Max visible points: Set the maximum number of points that will be displayed. The default is 2,000. The maximum is 50,000. If you set a number less than 1,000, the line chart will behave as if the maximum is 1,000 visible points. The actual maximum number of data points in the chart is affected by the distribution of the data, and could be lower than the value you configure with this setting. When there are more data points than the value you have set, data points are neither displayed, nor included in selections made in the chart.

  • Max visible lines: Set the maximum number of lines that will be displayed. The default is 12. The maximum is 1,000.

If there are more data points than the number set in Max visible points, you will not see any points, only lines. If there are more than 5,000 visible points, then labels will not be shown. If you have a large number of lines, not all lines will be displayed, or lines may overlap.

If you have a large number of points or lines, it may take your chart longer to render when you zoom or pan. You cannot make selections when the line chart is rendering.

A line chart with a large data set. This chart is set to display 50 lines, and 20,000 data points.

A line chart with many lines. Lines are overlapping, and not labels are displayed.

To avoid displaying limited data sets, you can either make a selection or use dimension limits in the properties panel.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!