Early Access: The content on this website is provided for informational purposes only in connection with pre-General Availability Qlik Products.
All content is subject to change and is provided without warranty.
Skip to main content Skip to complementary content

Creating line charts

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.

You can create a line chart on the sheet you are editing.

  1. In a sheet, click to add a new visualization.
  2. Under Visualization, select Line chart or Area line chart.
  3. Click Add and select a field or master dimension for the dimension.
  4. Click Add and select a field or master measure for the measure.

In a line chart you need at least one dimension and one measure.

You can include up to two dimensions and one measure, or one dimension and up to 15 measures in a line chart.

Creating a line chart
Dimensions Measures Result
1 dimension 1 measure A simple line chart with a single line.
2 dimensions 1 measure A line chart with the first dimension on the X-axis, and a line for each value of the second dimension.
1 dimension up to 15 measures A line chart with one line for each measure.

When you have created the line chart, you may want to adjust its appearance and other settings in the properties panel. For information about styling, see Styling the line chart. For information about customizing other aspects of the chart's appearance, see Changing the appearance of a visualization.

Styling the line chart

With Advanced options turned on, you have a number of styling options available in the properties panel. Click Styling under Appearance > Presentation to style the text, background, data point size, and lines at the chart level (for the entire chart). The styling panel contains various sections under the General and Chart tabs. You can reset your styles by clicking next to each section. Clicking Reset all resets styles for all available tabs in the styling panel. Any customization you apply here overrides the styling set in the app theme.

For general information about styling an individual visualization, see Applying custom styling to a visualization.

Customizing the text

You can set the text for the title, subtitle, and footnote under Appearance > General. To hide these elements, turn off Show titles.

The visibility of the different labels on the chart depends on chart-specific settings and label display options. These can be configured in the properties panel.

You can style the text that appears in the chart.

  1. Click Advanced options.

  2. In the properties panel, expand the Appearance section.

  3. Under AppearancePresentation, click Styling.

  4. On the General tab, set the font, emphasis style, font size, and color for the following text elements:

    • Title

    • Subtitle

    • Footnote

  5. On the Chart tab, set the font, font size, and color for the following text elements:

    • Axis title: Style the titles on the axes.

    • Axis label: Style the labels on the axes.

    • Value label: Style the labels for the measure values that are configured as Lines.

    • Legend title: Style the title of the legend.

    • Legend labels: Style the labels of the individual legend items.

Customizing the background

You can customize the background of the chart. The background can be set by color and image.

  1. Click Advanced options.

  2. In the properties panel, expand the Appearance section.

  3. Under AppearancePresentation, click Styling.

  4. On the General tab of the styling panel, you can select a background color (single color or expression). You can also set the background to an image from your media library or from a URL.

    Information note

    To add a background image from a URL, the URL's origin needs to be added to the allowlist in your tenant's Content Security Policy. The origin must be added with the following Directive: img-src. This is done by a tenant administrator.

    For more information, see Creating a CSP entry.

    When using a background color, use the slider to adjust the opacity of the background.

    When using a background image, you can adjust image sizing and position.

Customizing the data points at the chart level

You can set the size of the data points. The settings defined here apply to all measures in the chart.

  1. Click Advanced options.

  2. In the properties panel, expand the Appearance section.

  3. Under AppearancePresentation, click Styling.

  4. On the Chart tab of the styling panel, under Data point size, adjust the slider to change the size of the data points in the chart.

Customizing the measure lines at the chart level

You can customize the appearance of the lines in the chart. The settings defined here apply to all measures in the chart.

  1. Click Advanced options.

  2. In the properties panel, expand the Appearance section.

  3. Under AppearancePresentation, click Styling.

  4. Switch to the Chart tab of the styling panel.

  5. In the Line options section, adjust the line thickness, line type (solid or dashed), and line curve (linear or monotone).

Styling each measure individually

Each measure line in the chart can be styled with separate settings. For each measure, you can customize the data point size, line thickness, line type, and line curve.

  1. Click Advanced options.

  2. In the properties panel, expand the Data section.

  3. Click the measure you want to customize.

  4. Under Styling, click Add.

  5. Adjust the data point size, line thickness, line type (solid or dashed), and line curve (linear or monotone).

Repeat these steps for each individual measure you need to customize separately from the app theme or chart-level style settings.

Customizing the border and shadow

You can customize the border and shadow of the chart.

  1. Click Advanced options.

  2. In the properties panel, expand the Appearance section.

  3. Under AppearancePresentation, click Styling.

  4. On the General tab of the styling panel, under Border, adjust the Outline size to increase or decrease the border lines around the chart.

  5. Select a color for the border.

  6. Adjust the Corner radius to control the roundness of the border.

  7. Under Shadow in the General tab, select a shadow size and color. Select None to remove the shadow.

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.

Adding trend lines

You can add trend lines to the chart. Use trend lines to visualize how data changes over time.

For more information about trend lines, see Trend lines.

  1. In sheet edit mode, click Advanced options.

  2. In the properties panel, expand the Data section.

  3. Under Measures, expand the measure for which you are adding trend lines.

  4. Under Trend lines, click Add trend line.

  5. Define the Label and Type for the trend line.

  6. Use the Colors slider to define Custom or Auto coloring.

  7. Use the checkbox to toggle a Dashed appearance on or off.

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!