QScatterSeries Class

The QScatterSeries class is used for making scatter charts. More...

Header: #include <QScatterSeries>
Instantiated By: ScatterSeries
Inherits: QXYSeries

Public Types

enum MarkerShape { MarkerShapeCircle, MarkerShapeRectangle }

Properties

Public Functions

QScatterSeries(QObject *parent = Q_NULLPTR)
~QScatterSeries()
QColor borderColor() const
QBrush brush() const
MarkerShape markerShape() const
qreal markerSize() const
void setBorderColor(const QColor &color)
void setMarkerShape(MarkerShape shape)
void setMarkerSize(qreal size)

Reimplemented Public Functions

virtual QColor color() const
virtual void setBrush(const QBrush &brush)
virtual void setColor(const QColor &color)
virtual void setPen(const QPen &pen)
virtual QAbstractSeries::SeriesType type() const

Signals

void borderColorChanged(QColor color)
void colorChanged(QColor color)
void markerShapeChanged(MarkerShape shape)
void markerSizeChanged(qreal size)

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 11 static public members inherited from QObject
  • 9 protected functions inherited from QObject

Detailed Description

The QScatterSeries class is used for making scatter charts.

The scatter data is displayed as a collection of points on the chart. Each point determines the position on the horizontal axis and the vertical axis.

Creating basic scatter chart is simple:

QScatterSeries* series = new QScatterSeries();
series->append(0, 6);
series->append(2, 4);
...
chart->addSeries(series);

Member Type Documentation

enum QScatterSeries::MarkerShape

This enum describes the shape used when rendering marker items.

ConstantValue
QScatterSeries::MarkerShapeCircle0
QScatterSeries::MarkerShapeRectangle1

Property Documentation

borderColor : QColor

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

Access functions:

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

Notifier signal:

void borderColorChanged(QColor color)

See also QScatterSeries::pen().

brush : QBrush

Brush used to draw the series.

Access functions:

QBrush brush() const
virtual void setBrush(const QBrush &brush)

color : QColor

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

Access functions:

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

Notifier signal:

void colorChanged(QColor color)

See also QScatterSeries::brush().

markerShape : MarkerShape

Defines the shape of the marker used to draw the points in the series. The default shape is MarkerShapeCircle.

Access functions:

MarkerShape markerShape() const
void setMarkerShape(MarkerShape shape)

Notifier signal:

void markerShapeChanged(MarkerShape shape)

markerSize : qreal

Defines the size of the marker used to draw the points in the series. The default size is 15.0.

Access functions:

qreal markerSize() const
void setMarkerSize(qreal size)

Notifier signal:

void markerSizeChanged(qreal size)

Member Function Documentation

QScatterSeries::QScatterSeries(QObject *parent = Q_NULLPTR)

Constructs a series object which is a child of parent.

QScatterSeries::~QScatterSeries()

Destroys the object. Note that adding series to QChart transfers the ownership to the chart.

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

Signal is emitted when the line (pen) color has changed to color.

Note: Notifier signal for property borderColor.

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

Signal is emitted when the fill (brush) color has changed to color.

Note: Notifier signal for property color.

[signal] void QScatterSeries::markerShapeChanged(MarkerShape shape)

Signal is emitted when the marker shape has changed to shape.

Note: Notifier signal for property markerShape.

[signal] void QScatterSeries::markerSizeChanged(qreal size)

Signal is emitted when the marker size has changed to size.

Note: Notifier signal for property markerSize.

[virtual] void QScatterSeries::setBrush(const QBrush &brush)

Reimplemented from QXYSeries::setBrush().

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

Note: Setter function for property brush.

See also brush() and QChart::setTheme().

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

Reimplemented from QXYSeries::setPen().

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

See also QChart::setTheme().

[virtual] QAbstractSeries::SeriesType QScatterSeries::type() const

Reimplemented from QAbstractSeries::type().

Returns QAbstractSeries::SeriesTypeScatter.

See also QAbstractSeries and SeriesType.

© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.