QLineSeries Class
The QLineSeries class draws its points joined by straight lines. More…
| Header | #include <QLineSeries> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Charts) |
| Module | Nt Charts C++ Classes |
| Inherits | QXYSeries |
| Inherited by | QSplineSeries |
List of all members, including inherited members
Public Functions
| QLineSeries(QObject *parent = nullptr) | |
| ~QLineSeries() |
Reimplemented Public Functions
| QAbstractSeries::SeriesType | type() const |
Detailed Description

auto *series = new QLineSeries;
series->setName("CPU");
for (int t = 0; t < 60; ++t)
series->append(t, sample(t));
auto *chart = new QChart;
chart->setTitle("Load");
chart->addSeries(series);
chart->createDefaultAxes();
chart->axes(Qt::Vertical).first()->setRange(0, 100);
The points are joined in the order they are in, which need not be the order of their x values.
See also QSplineSeries and QXYSeries.
Differences from Qt
See QXYSeries.
Member Function Documentation
QLineSeries::QLineSeries(QObject *parent = nullptr)
Constructs an empty line series with the given parent.
QLineSeries::~QLineSeries()
Destroys the series.
QAbstractSeries::SeriesType QLineSeries::type() const
Reimplements QXYSeries::type().
Returns QAbstractSeries::SeriesTypeLine.