QScatterSeries Class | Qt Charts 5.7

Qt 5.7 | Qt Charts | C++ Classes | QScatterSeries

Qt 5.7.1 Reference Documentation

# QScatterSeries Class

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

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

- List of all members, including inherited members

## Public Types

enum | MarkerShape { MarkerShapeCircle, MarkerShapeRectangle }

## Properties

borderColor : QColor brush : QBrush color : QColor | markerShape : MarkerShape markerSize : qreal

- 7 properties inherited from QXYSeries
- 5 properties inherited from QAbstractSeries

## 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

- 39 public functions inherited from QXYSeries
- 15 public functions inherited from QAbstractSeries

## Signals

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

- 17 signals inherited from QXYSeries
- 4 signals inherited from QAbstractSeries

## 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.

Constant | Value
--- | ---
`QScatterSeries::MarkerShapeCircle` | `0`
`QScatterSeries::MarkerShapeRectangle` | `1`

## 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.