QAreaSeries Class

The QAreaSeries class presents data in area charts. 更多...

头: #include <QAreaSeries>
实例化: AreaSeries
继承: QAbstractSeries

特性

公共函数

QAreaSeries (QLineSeries * upperSeries , QLineSeries * lowerSeries = nullptr)
QAreaSeries (QObject * parent = nullptr)
virtual ~QAreaSeries ()
QColor borderColor () const
QBrush brush () const
QColor color () const
QLineSeries * lowerSeries () const
QPen pen () const
bool pointLabelsClipping () const
QColor pointLabelsColor () const
QFont pointLabelsFont () const
QString pointLabelsFormat () const
bool pointLabelsVisible () const
bool pointsVisible () const
void setBorderColor (const QColor & color )
void setBrush (const QBrush & brush )
void setColor (const QColor & color )
void setLowerSeries (QLineSeries * series )
void setPen (const QPen & pen )
void setPointLabelsClipping (bool enabled = true)
void setPointLabelsColor (const QColor & color )
void setPointLabelsFont (const QFont & font )
void setPointLabelsFormat (const QString & format )
void setPointLabelsVisible (bool visible = true)
void setPointsVisible (bool visible = true)
void setUpperSeries (QLineSeries * series )
QLineSeries * upperSeries () const

重实现公共函数

virtual QAbstractSeries::SeriesType type () const override

信号

void borderColorChanged (QColor color )
void clicked (const QPointF & point )
void colorChanged (QColor color )
void doubleClicked (const QPointF & point )
void hovered (const QPointF & point , bool state )
void pointLabelsClippingChanged (bool clipping )
void pointLabelsColorChanged (const QColor & color )
void pointLabelsFontChanged (const QFont & font )
void pointLabelsFormatChanged (const QString & format )
void pointLabelsVisibilityChanged (bool visible )
void pressed (const QPointF & point )
void released (const QPointF & point )

详细描述

An area series is used to show quantitative data. It is based on a line series, in the way that the area between the boundary lines is emphasized with color. Since the area series is based on the line series, the QAreaSeries constructor needs a QLineSeries instance, which defines the upper boundary of the area. The area chart is drawn using the bottom of the plot area as the lower boundary by default. Instead of the bottom of the plot area, the lower boundary can be specified by another line. In that case, QAreaSeries should be initialized with two QLineSeries 实例。

注意: The terms upper and lower boundary can be misleading in cases where the value of the lower boundary is greater than that of the upper boundary. The main point is that the area between these two boundary lines will be filled.

area chart example to learn how to create a simple area chart.

特性文档编制

borderColor : QColor

This property holds the line (pen) color of the series. This is a convenience property for modifying the color of the pen.

访问函数:

QColor borderColor () const
void setBorderColor (const QColor & color )

通知程序信号:

void borderColorChanged (QColor color )

另请参阅 QAreaSeries::pen ().

color : QColor

This property holds the fill (brush) color of the series. This is a convenience property for modifying the color of the brush.

访问函数:

QColor color () const
void setColor (const QColor & color )

通知程序信号:

void colorChanged (QColor color )

另请参阅 QAreaSeries::brush ().

lowerSeries : QtCharts::QLineSeries * const

This property holds the lower one of the two line series used to define area series boundaries.

注意: QAreaSeries was constructed without a lowerSeries, this is null.

访问函数:

QLineSeries * lowerSeries () const

pointLabelsClipping : bool

This property holds the clipping for data point labels. True by default. The labels on the edge of the plot area are cut when clipping is enabled.

访问函数:

bool pointLabelsClipping () const
void setPointLabelsClipping (bool enabled = true)

通知程序信号:

void pointLabelsClippingChanged (bool clipping )

另请参阅 pointLabelsVisible .

pointLabelsColor : QColor

This property holds the color used for data point labels. By default, the color is the color of the brush defined for labels in the theme.

访问函数:

QColor pointLabelsColor () const
void setPointLabelsColor (const QColor & color )

通知程序信号:

void pointLabelsColorChanged (const QColor & color )

另请参阅 QAreaSeries::pointLabelsFormat .

pointLabelsFont : QFont

This property holds the font used for data point labels.

访问函数:

QFont pointLabelsFont () const
void setPointLabelsFont (const QFont & font )

通知程序信号:

void pointLabelsFontChanged (const QFont & font )

另请参阅 QAreaSeries::pointLabelsFormat .

pointLabelsFormat : QString

This property holds the format used for showing labels with series points.

QAreaSeries supports the following format tags:

@xPoint The x value of the data point
@yPoint The y value of the data point

For example, the following usage of the format tags would produce labels that have the data point (x, y) shown inside brackets separated by a comma:

series->setPointLabelsFormat("(@xPoint, @yPoint)");
					

By default, the label format is set to @xPoint, @yPoint . The labels are shown on the plot area, whereas labels on the edge of the plot area are cut. If the points are close to each other, the labels may overlap.

访问函数:

QString pointLabelsFormat () const
void setPointLabelsFormat (const QString & format )

通知程序信号:

void pointLabelsFormatChanged (const QString & format )

另请参阅 QAreaSeries::pointLabelsVisible , QAreaSeries::pointLabelsFont ,和 QAreaSeries::pointLabelsColor .

pointLabelsVisible : bool

This property holds the visibility of data point labels. False by default.

访问函数:

bool pointLabelsVisible () const
void setPointLabelsVisible (bool visible = true)

通知程序信号:

void pointLabelsVisibilityChanged (bool visible )

另请参阅 QAreaSeries::pointLabelsFormat and QAreaSeries::pointLabelsClipping .

upperSeries : QtCharts::QLineSeries * const

This property holds the upper one of the two line series used to define area series boundaries.

访问函数:

QLineSeries * upperSeries () const

成员函数文档编制

QAreaSeries:: QAreaSeries ( QLineSeries * upperSeries , QLineSeries * lowerSeries = nullptr)

Constructs an area series object that will be spanned between an upperSeries line and a lowerSeries line. If no lowerSeries is passed to the constructor, the x-axis is used as the lower bound instead.

The QAreaSeries does not own the upper or lower series, but the ownership stays with the caller. When the series object is added to QChartView or QChart , the instance ownership is transferred.

QAreaSeries:: QAreaSeries ( QObject * parent = nullptr)

Constructs an area series object without an upper or a lower series with the parent 对象。

[signal] void QAreaSeries:: borderColorChanged ( QColor color )

This signal is emitted when the line (pen) color changes to color .

注意: 通知程序信号对于特性 borderColor .

[signal] void QAreaSeries:: clicked (const QPointF & point )

This signal is emitted when the user triggers a press on point by clicking it in an area chart.

另请参阅 pressed , released ,和 doubleClicked .

[signal] void QAreaSeries:: colorChanged ( QColor color )

This signal is emitted when the fill (brush) color changes to color .

注意: 通知程序信号对于特性 color .

[signal] void QAreaSeries:: doubleClicked (const QPointF & point )

This signal is emitted when the user triggers the first press in an area chart by doubleclicking point .

另请参阅 pressed , released ,和 clicked .

[signal] void QAreaSeries:: hovered (const QPointF & point , bool state )

This signal is emitted when the user hovers the mouse cursor over a series or moves it away from the series. point shows the origin (coordinate) of the hover event. state is true when the cursor hovers over the series and turns false when it moves away from the series.

[signal] void QAreaSeries:: pointLabelsClippingChanged ( bool clipping )

This signal is emitted when the clipping of the data point labels changes to clipping .

注意: 通知程序信号对于特性 pointLabelsClipping .

[signal] void QAreaSeries:: pointLabelsColorChanged (const QColor & color )

This signal is emitted when the color used for data point labels changes to color .

注意: 通知程序信号对于特性 pointLabelsColor .

[signal] void QAreaSeries:: pointLabelsFontChanged (const QFont & font )

This signal is emitted when the font used for data point labels changes to font .

注意: 通知程序信号对于特性 pointLabelsFont .

[signal] void QAreaSeries:: pointLabelsFormatChanged (const QString & format )

此信号发射当 format of data point labels is changed.

注意: 通知程序信号对于特性 pointLabelsFormat .

[signal] void QAreaSeries:: pointLabelsVisibilityChanged ( bool visible )

This signal is emitted when the visibility of the data point labels changes to visible .

注意: 通知程序信号对于特性 pointLabelsVisible .

[signal] void QAreaSeries:: pressed (const QPointF & point )

This signal is emitted when the user presses the point specified by point in an area chart.

另请参阅 clicked , released ,和 doubleClicked .

[signal] void QAreaSeries:: released (const QPointF & point )

This signal is emitted when the user releases a press that was triggered on point in an area chart.

另请参阅 pressed , clicked ,和 doubleClicked .

[虚拟] QAreaSeries:: ~QAreaSeries ()

销毁对象。

QBrush QAreaSeries:: brush () const

Returns the brush used to draw the line for this series.

另请参阅 setBrush ().

QPen QAreaSeries:: pen () const

Returns the pen used to draw the line for this series.

另请参阅 setPen ().

bool QAreaSeries:: pointsVisible () const

Returns whether the points are drawn for this series.

另请参阅 setPointsVisible ().

void QAreaSeries:: setBrush (const QBrush & brush )

设置 brush used for filling the area.

另请参阅 brush ().

void QAreaSeries:: setLowerSeries ( QLineSeries * series )

设置 series that is to be used as the area chart lower series.

另请参阅 lowerSeries ().

void QAreaSeries:: setPen (const QPen & pen )

设置 pen used for drawing the area outline.

另请参阅 pen ().

void QAreaSeries:: setPointsVisible ( bool visible = true)

Determines whether data points are visible and should be drawn on the line.

另请参阅 pointsVisible ().

void QAreaSeries:: setUpperSeries ( QLineSeries * series )

设置 series that is to be used as the area chart upper series. If the upper series is null, the area chart is not drawn, even if it has a lower series.

另请参阅 upperSeries ().

[override virtual] QAbstractSeries::SeriesType QAreaSeries:: type () const

重实现访问函数为特性: QAbstractSeries::type .

返回 QAbstractSeries::SeriesTypeArea .