6.0.0-rc4Source

QAbstractSeries Class

The QAbstractSeries class is the base class of the data series of a chart. More…

Header#include <QAbstractSeries>
CMaketarget_link_libraries(app PRIVATE Nt::Charts)
ModuleNt Charts C++ Classes
InheritsQObject
Inherited byQAbstractBarSeries, QAreaSeries, QPieSeries, QXYSeries

List of all members, including inherited members

Public Types

Public Functions

~QAbstractSeries()
virtual SeriesTypetype() const
voidsetName(const QString &name)
QStringname() const
voidsetVisible(bool visible = true)
boolisVisible() const
qrealopacity() const
voidsetOpacity(qreal opacity)
voidsetUseOpenGL(bool enable = true)
booluseOpenGL() const
QChart *chart() const
boolattachAxis(QAbstractAxis *axis)
booldetachAxis(QAbstractAxis *axis)
QList<QAbstractAxis *>attachedAxes()
voidshow()
voidhide()

Signals

Protected Functions

QAbstractSeries(QObject *parent = nullptr)
voidmarkChanged()

Detailed Description

A series holds data and the way it is drawn. Add it to a chart with QChart::addSeries(); the chart then owns it. A series is drawn against the axes attached to it with attachAxis(), or, with none, against a scale that fits its data.

See also QChart, QXYSeries, QAbstractBarSeries, QPieSeries and QAreaSeries.

Differences from Qt

The series is drawn by the chart; there is no OpenGL acceleration, and useOpenGL() is kept but has no effect. A series has at most one axis of each orientation: attaching a second one detaches the first.

Member Type Documentation

enum QAbstractSeries::SeriesType

The type of a series.

ConstantDescription
QAbstractSeries::SeriesTypeLineA QLineSeries.
QAbstractSeries::SeriesTypeAreaA QAreaSeries.
QAbstractSeries::SeriesTypeBarA QBarSeries.
QAbstractSeries::SeriesTypeStackedBarA QStackedBarSeries.
QAbstractSeries::SeriesTypePercentBarA QPercentBarSeries.
QAbstractSeries::SeriesTypePieA QPieSeries.
QAbstractSeries::SeriesTypeScatterA QScatterSeries.
QAbstractSeries::SeriesTypeSplineA QSplineSeries.
QAbstractSeries::SeriesTypeHorizontalBarA QHorizontalBarSeries.
QAbstractSeries::SeriesTypeHorizontalStackedBarA QHorizontalStackedBarSeries.
QAbstractSeries::SeriesTypeHorizontalPercentBarA QHorizontalPercentBarSeries.
QAbstractSeries::SeriesTypeBoxPlotA box plot series; Nt has none.
QAbstractSeries::SeriesTypeCandlestickA candlestick series; Nt has none.

Member Function Documentation

[explicit, protected] QAbstractSeries::QAbstractSeries(QObject *parent = nullptr)

Constructs a series with the given parent.

[override] QAbstractSeries::~QAbstractSeries()

Destroys the series and removes it from its chart.

bool QAbstractSeries::attachAxis(QAbstractAxis *axis)

Attaches axis to the series, so that the series is drawn against it. Both must be in the same chart. An axis of the same orientation that was attached before is detached. Returns true on success.

If the range of axis was not set, it becomes the extent of the data of its series.

See also detachAxis() and QChart::addAxis().

QList<QAbstractAxis *> QAbstractSeries::attachedAxes()

Returns the axes attached to the series.

QChart * QAbstractSeries::chart() const

Returns the chart the series is in, or nullptr if it is in none.

bool QAbstractSeries::detachAxis(QAbstractAxis *axis)

Detaches axis from the series. Returns true on success.

void QAbstractSeries::hide()

Hides the series.

bool QAbstractSeries::isVisible() const

Returns true if the series is drawn; otherwise returns false.

[protected] void QAbstractSeries::markChanged()

Tells the chart that the series must be drawn again.

QString QAbstractSeries::name() const

Returns the name of the series.

[signal] void QAbstractSeries::nameChanged()

This signal is emitted when the name of the series changes.

qreal QAbstractSeries::opacity() const

Returns the opacity of the series, from 0.0 (transparent) to 1.0 (opaque).

[signal] void QAbstractSeries::opacityChanged()

This signal is emitted when the opacity of the series changes.

void QAbstractSeries::setName(const QString &name)

Sets the name of the series to name. The legend shows it.

void QAbstractSeries::setOpacity(qreal opacity)

Sets the opacity of the series to opacity, from 0.0 (transparent) to 1.0 (opaque).

void QAbstractSeries::setUseOpenGL(bool enable = true)

Sets whether the series asks for OpenGL to enable. Nt draws every series the same way, so this has no effect.

void QAbstractSeries::setVisible(bool visible = true)

Shows the series if visible is true and hides it otherwise.

void QAbstractSeries::show()

Shows the series.

[virtual] SeriesType QAbstractSeries::type() const

Returns the type of the series.

bool QAbstractSeries::useOpenGL() const

Returns true if setUseOpenGL() was set; otherwise returns false.

[signal] void QAbstractSeries::useOpenGLChanged()

This signal is emitted when useOpenGL() changes.

[signal] void QAbstractSeries::visibleChanged()

This signal is emitted when the series is shown or hidden.