IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QXYSeries Class

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QXYSeries Class

Detailed Description

 

Property Documentation

 

color : QColor

This property holds the color of the series.

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

Access functions:

  • virtual color() const

  • virtual void setColor(const &color)

Notifier signal:

See Also

See also pen(), brush()

pointLabelsClipping : bool

This property holds the clipping for data point labels.

This property is true by default. The labels on the edge of the plot area are cut when clipping is enabled.

Access functions:

  • bool pointLabelsClipping() const

  • void setPointLabelsClipping(bool enabled = true)

Notifier signal:

See Also

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.

Access functions:

  • pointLabelsColor() const

  • void setPointLabelsColor(const &color)

Notifier signal:

See Also

pointLabelsFont : QFont

This property holds the font used for data point labels.

Access functions:

  • pointLabelsFont() const

  • void setPointLabelsFont(const &font)

Notifier signal:

See Also

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):

 
Sélectionnez
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.

Access functions:

  • pointLabelsFormat() const

  • void setPointLabelsFormat(const &format)

Notifier signal:

See Also

pointLabelsVisible : bool

This property holds the visibility of data point labels.

This property is false by default.

Access functions:

  • bool pointLabelsVisible() const

  • void setPointLabelsVisible(bool visible = true)

Notifier signal:

See Also

pointsVisible : bool

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

Access functions:

  • bool pointsVisible() const

  • void setPointsVisible(bool visible = true)

Member Function Documentation

 

[virtual] QXYSeries::~QXYSeries()

Deletes the series. Series added to QChart instances are owned by them, and are deleted when the QChart instances are deleted.

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

Adds the data point with the coordinates x and y to the series.

void QXYSeries::append(const QPointF &point)

This is an overloaded function.

Adds the data point point to the series.

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

This is an overloaded function.

Adds the list of data points specified by points to the series.

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

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

QBrush QXYSeries::brush() const

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

See Also

See also setBrush()

void QXYSeries::clear()

Removes all points from the series.

See Also

See also pointsRemoved()

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.

See Also

See also pressed(), released(), doubleClicked()

void QXYSeries::colorChanged(QColor color)

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

Notifier signal for property color.

int QXYSeries::count() const

Returns the number of data points in a series.

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.

See Also

See also pressed(), released(), clicked()

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.

See Also

See also pointAdded()

QPen QXYSeries::pen() const

Returns the pen used to draw the outline of the data points for the series.

See Also

See also setPen()

void QXYSeries::penChanged(const QPen &pen)

This signal is emitted when the pen changes to pen.

void QXYSeries::pointAdded(int index)

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

See Also

See also append(), insert()

void QXYSeries::pointLabelsClippingChanged(bool clipping)

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

Notifier signal for property pointLabelsClipping.

void QXYSeries::pointLabelsColorChanged(const QColor &color)

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

Notifier signal for property pointLabelsColor.

void QXYSeries::pointLabelsFontChanged(const QFont &font)

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

Notifier signal for property pointLabelsFont.

void QXYSeries::pointLabelsFormatChanged(const QString &format)

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

Notifier signal for property pointLabelsFormat.

void QXYSeries::pointLabelsVisibilityChanged(bool visible)

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

Notifier signal for property pointLabelsVisible.

void QXYSeries::pointRemoved(int index)

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

See Also

See also remove()

void QXYSeries::pointReplaced(int index)

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

See Also

See also replace()

QList<QPointF> QXYSeries::points() const

Returns the points in the series.

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.

See Also

See also removePoints(), clear()

void QXYSeries::pointsReplaced()

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

See Also

See also replace()

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.

See Also

See also clicked(), released(), doubleClicked()

void QXYSeries::released(const QPointF &point)

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

See Also

See also pressed(), clicked(), doubleClicked()

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

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

See Also

See also pointRemoved()

void QXYSeries::remove(const QPointF &point)

Removes the data point point from the series.

See Also

See also pointRemoved()

void QXYSeries::remove(int index)

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

See Also

See also 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.

See Also

See also 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.

See Also

See also pointReplaced()

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

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

See Also

See also 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.

See Also

See also pointReplaced()

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

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

See Also

See also pointReplaced()

void QXYSeries::replace(const 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.

See Also

See also pointsReplaced()

[virtual] 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.

See Also

See also brush(), QChart::setTheme()

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

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

See Also

See also pen(), QChart::setTheme()

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

Stream operator for adding the data point point to the series.

See Also

See also append()

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

Stream operator for adding the list of data points specified by points to the series.

See Also

See also append()

Obsolete Members for QXYSeries

The following members of class QXYSeries are deprecated. We strongly advise against using them in new code.

Obsolete Member Function Documentation

 
QList<QPointF> QXYSeries::pointsVector() const

This function is deprecated. We strongly advise against using it in new code.

Use points() instead. Returns the points in the series.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+