QXYSeries 類

The QXYSeries class 是綫、樣條綫及散點係列的基類。 更多...

頭: #include <QXYSeries>
實例化: XYSeries
繼承: QAbstractSeries
繼承者: QLineSeries and QScatterSeries

特性

公共函數

~QXYSeries ()
void append (qreal x , qreal y )
void append (const QPointF & point )
void append (const QList<QPointF> & points )
const QPointF & at (int index ) const
QBrush brush () const
void clear ()
virtual QColor color () const
int count () const
void insert (int index , const QPointF & point )
QPen pen () const
bool pointLabelsClipping () const
QColor pointLabelsColor () const
QFont pointLabelsFont () const
QString pointLabelsFormat () const
bool pointLabelsVisible () const
QList<QPointF> points () const
QVector<QPointF> pointsVector () const
bool pointsVisible () const
void remove (qreal x , qreal y )
void remove (const QPointF & point )
void remove (int index )
void removePoints (int index , int count )
void replace (qreal oldX , qreal oldY , qreal newX , qreal newY )
void replace (const QPointF & oldPoint , const QPointF & newPoint )
void replace (int index , qreal newX , qreal newY )
void replace (int index , const QPointF & newPoint )
void replace (QList<QPointF> points )
void replace (QVector<QPointF> points )
virtual void setBrush (const QBrush & brush )
virtual void setColor (const QColor & color )
virtual 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)
QXYSeries & operator<< (const QPointF & point )
QXYSeries & operator<< (const QList<QPointF> & points )

信號

void clicked (const QPointF & point )
void colorChanged (QColor color )
void doubleClicked (const QPointF & point )
void hovered (const QPointF & point , bool state )
void penChanged (const QPen & pen )
void pointAdded (int index )
void pointLabelsClippingChanged (bool clipping )
void pointLabelsColorChanged (const QColor & color )
void pointLabelsFontChanged (const QFont & font )
void pointLabelsFormatChanged (const QString & format )
void pointLabelsVisibilityChanged (bool visible )
void pointRemoved (int index )
void pointReplaced (int index )
void pointsRemoved (int index , int count )
void pointsReplaced ()
void pressed (const QPointF & point )
void released (const QPointF & point )

額外繼承成員

詳細描述

The QXYSeries class 是綫、樣條綫及散點係列的基類。

特性文檔編製

color : QColor

此特性保持係列的顔色。

This is the line (pen) color in case of QLineSeries or QSplineSeries and the fill (brush) color in case of QScatterSeries or QAreaSeries .

訪問函數:

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

通知程序信號:

void colorChanged (QColor color )

另請參閱 pen () 和 brush ().

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 in theme for labels.

訪問函數:

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

通知程序信號:

void pointLabelsColorChanged (const QColor & color )

另請參閱 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 )

另請參閱 pointLabelsFormat .

pointLabelsFormat : QString

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

QXYSeries supports the following format tags:

@xPoint The x-coordinate of the data point.
@yPoint The y-coordinate of the data point.

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

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

By default, the labels' format is set to @xPoint, @yPoint . The labels are shown on the plot area, and the 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 )

另請參閱 pointLabelsVisible , pointLabelsFont ,和 pointLabelsColor .

pointLabelsVisible : bool

此特性保持數據點標簽的可見性。

此特性是 false 在默認情況下。

訪問函數:

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

通知程序信號:

void pointLabelsVisibilityChanged (bool visible )

另請參閱 pointLabelsFormat and pointLabelsClipping .

pointsVisible : bool

This property holds whether the data points are visible and should be drawn.

訪問函數:

bool pointsVisible () const
void setPointsVisible (bool visible = true)

成員函數文檔編製

QXYSeries:: ~QXYSeries ()

刪除係列。係列被添加到 QChart instances are owned by them, and are deleted when the QChart instances are deleted.

void QXYSeries:: append ( qreal x , qreal y )

添加的數據點帶坐標 x and y 到係列。

void QXYSeries:: append (const QPointF & point )

這是重載函數。

添加數據點 point 到係列。

void QXYSeries:: append (const QList < QPointF > & points )

這是重載函數。

Adds the list of data points specified by points 到係列。

const QPointF &QXYSeries:: at ( int index ) const

Returns the data point at the position specified by index in the internal points vector.

QBrush QXYSeries:: brush () const

Returns the brush used to fill the data points for the series.

另請參閱 setBrush ().

void QXYSeries:: clear ()

從係列刪除所有點。

另請參閱 pointsRemoved ().

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

This signal is emitted when the user triggers a mouse event by clicking the point point in the chart.

另請參閱 pressed (), released (),和 doubleClicked ().

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

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

注意: 通知程序信號對於特性 color .

int QXYSeries:: count () const

返迴係列中的數據點數。

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

This signal is emitted when the user double-clicks the data point point in the chart. The point is the point where the first press was triggered.

另請參閱 pressed (), released (),和 clicked ().

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

This signal is emitted when a mouse is hovered over the point point in the chart. When the mouse moves over the point, state turns true , and when the mouse moves away again, it turns false .

void QXYSeries:: insert ( int index , const QPointF & point )

Inserts the data point point in the series at the position specified by index .

另請參閱 pointAdded ().

QPen QXYSeries:: pen () const

返迴用於繪製係列數據點輪廓的鋼筆。

另請參閱 setPen ().

[signal] void QXYSeries:: penChanged (const QPen & pen )

此信號被發射當鋼筆更改為 pen .

[signal] void QXYSeries:: pointAdded ( int index )

This signal is emitted when a point is added at the position specified by index .

另請參閱 append () 和 insert ().

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

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

注意: 通知程序信號對於特性 pointLabelsClipping .

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

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

注意: 通知程序信號對於特性 pointLabelsColor .

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

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

注意: 通知程序信號對於特性 pointLabelsFont .

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

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

注意: 通知程序信號對於特性 pointLabelsFormat .

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

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

注意: 通知程序信號對於特性 pointLabelsVisible .

[signal] void QXYSeries:: pointRemoved ( int index )

This signal is emitted when a point is removed from the position specified by index .

另請參閱 remove ().

[signal] void QXYSeries:: pointReplaced ( int index )

This signal is emitted when a point is replaced at the position specified by index .

另請參閱 replace ().

QList < QPointF > QXYSeries:: points () const

Returns the points in the series as a list. Use pointsVector () for better performance.

[signal] void QXYSeries:: pointsRemoved ( int index , int count )

This signal is emitted when the number of points specified by count is removed starting at the position specified by index .

另請參閱 removePoints () 和 clear ().

[signal] void QXYSeries:: pointsReplaced ()

This signal is emitted when all points are replaced with other points.

另請參閱 replace ().

QVector < QPointF > QXYSeries:: pointsVector () const

Returns the points in the series as a vector. This is more efficient than calling points ().

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

This signal is emitted when the user presses the data point point in the chart and holds down the mouse button.

另請參閱 clicked (), released (),和 doubleClicked ().

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

This signal is emitted when the user releases the mouse press on the data point specified by point .

另請參閱 pressed (), clicked (),和 doubleClicked ().

void QXYSeries:: remove ( qreal x , qreal y )

Removes the point that has the coordinates x and y from the series.

另請參閱 pointRemoved ().

void QXYSeries:: remove (const QPointF & point )

Removes the data point point from the series.

另請參閱 pointRemoved ().

void QXYSeries:: remove ( int index )

Removes the point at the position specified by index from the series.

另請參閱 pointRemoved ().

void QXYSeries:: removePoints ( int index , int count )

Removes the number of points specified by count from the series starting at the position specified by index .

另請參閱 pointsRemoved ().

void QXYSeries:: replace ( qreal oldX , qreal oldY , qreal newX , qreal newY )

Replaces the point with the coordinates oldX and oldY with the point with the coordinates newX and newY . Does nothing if the old point does not exist.

另請參閱 pointReplaced ().

void QXYSeries:: replace (const QPointF & oldPoint , const QPointF & newPoint )

Replaces the point specified by oldPoint with the one specified by newPoint .

另請參閱 pointReplaced ().

void QXYSeries:: replace ( int index , qreal newX , qreal newY )

Replaces the point at the position specified by index with the point that has the coordinates newX and newY .

另請參閱 pointReplaced ().

void QXYSeries:: replace ( int index , const QPointF & newPoint )

Replaces the point at the position specified by index with the point specified by newPoint .

另請參閱 pointReplaced ().

void QXYSeries:: replace ( QList < QPointF > points )

Replaces the current points with the points specified by points .

注意: This is much faster than replacing data points one by one, or first clearing all data, and then appending the new data. Emits QXYSeries::pointsReplaced () when the points have been replaced. However, note that using the overload that takes QVector<QPointF> as parameter is faster than using this overload.

另請參閱 pointsReplaced ().

void QXYSeries:: replace ( QVector < QPointF > points )

Replaces the current points with the points specified by points .

注意: This is much faster than replacing data points one by one, or first clearing all data, and then appending the new data. Emits QXYSeries::pointsReplaced () when the points have been replaced.

另請參閱 pointsReplaced ().

[虛擬] void QXYSeries:: setBrush (const QBrush & brush )

Sets the brush used for drawing points on the chart to brush . If the brush is not defined, the brush from the chart theme setting is used.

另請參閱 brush () 和 QChart::setTheme ().

[虛擬] void QXYSeries:: setPen (const QPen & pen )

將用於在圖錶中繪製點的鋼筆設為 pen 。若鋼筆未定義,則使用來自圖錶主題的鋼筆。

另請參閱 pen () 和 QChart::setTheme ().

QXYSeries &QXYSeries:: operator<< (const QPointF & point )

流運算符用於添加數據點 point 到係列。

另請參閱 append ().

QXYSeries &QXYSeries:: operator<< (const QList < QPointF > & points )

流運算符用於添加數據點列錶指定通過 points 到係列。

另請參閱 append ().