- Qt 6.11
- Qt Graphs
- C++ Classes
- QtGraphs
- QLineSeries
- Qt Graphs | Commercial or GPLv3

# QLineSeries Class

The QLineSeries class presents data in line graphs. More...

Header: | `#include <QLineSeries>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS Graphs)` `target_link_libraries(mytarget PRIVATE Qt6::Graphs)`
qmake: | `QT += graphs`
In QML: | LineSeries
Inherits: | QXYSeries

- List of all members, including inherited members
- QLineSeries is part of Qt Graphs C++ Classes for 2D.

## Public Types

`(since 6.11)` enum class | LineStyle { Straight, StepLeft, StepRight, StepCenter }

## Properties

- capStyle : Qt::PenCapStyle
- width : qreal

## Public Functions

Qt::PenCapStyle | capStyle() const
QPointF | dataPointCoordinatesAt(qreal x, qreal y)
Qt::PenJoinStyle | joinStyle() const
QLineSeries::LineStyle | lineStyle() const
void | setCapStyle(Qt::PenCapStyle newCapStyle)
void | setJoinStyle(Qt::PenJoinStyle newJoinStyle)
void | setLineStyle(QLineSeries::LineStyle newLineStyle)
void | setWidth(qreal newWidth)
qreal | width() const

## Signals

void | capStyleChanged()
void | joinStyleChanged()
void | lineStyleChanged()
void | widthChanged()

## Detailed Description

A line graph is used to show information as a series of data points connected by straight lines or steps.

## Member Type Documentation

### `[since 6.11]` enum class QLineSeries::LineStyle

Represents the line style of the series.

Constant | Value | Description
--- | --- | ---
`QLineSeries::LineStyle::Straight` | `0` | The points are connected by a straight line.
`QLineSeries::LineStyle::StepLeft` | `1` | The points are connected by steps where each step height is the value from the left.
`QLineSeries::LineStyle::StepRight` | `2` | The points are connected by steps where each step height is the value from the right.
`QLineSeries::LineStyle::StepCenter` | `3` | The points are connected by steps which change in the middle between two values.

This enum was introduced in Qt 6.11.

## Property Documentation

### capStyle : Qt::PenCapStyle

This property holds the cap style used for line endings.

This property holds the pen cap style used for rending line ends in the series.

Access functions:

Qt::PenCapStyle | capStyle() const
void | setCapStyle(Qt::PenCapStyle newCapStyle)

Notifier signal:

void | capStyleChanged()

### width : qreal

This property holds the width of the line in the series.

This property holds the pen width used to draw the series line.

Access functions:

qreal | width() const
void | setWidth(qreal newWidth)

Notifier signal:

void | widthChanged()

## Member Function Documentation

### `[invokable]` QPointF QLineSeries::dataPointCoordinatesAt(qreal x, qreal y)

Returns x and y rendercoordinates converted into data point coordinates.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.