QScatterSeries Class

The QScatterSeries class presents data in scatter charts. 更多...

头文件: #include <QScatterSeries>
Instantiated By: ScatterSeries
基类: QXYSeries

公有类型

enum MarkerShape { MarkerShapeCircle, MarkerShapeRectangle }

属性

公有函数

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)

重新实现的公有函数

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

信号

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

其他继承的成员

  • 1 个公有槽函数继承自 QObject
  • 1 个公有变量继承自 QObject
  • 10 个静态公有成员继承自 QObject
  • 9 个受保护的函数继承自 QObject
  • 2 个受保护的变量继承自 QObject

详细描述

The QScatterSeries class presents data in scatter charts.

The scatter data is displayed as a collection of points on the chart. For each point, two values are specified that determine its position on the horizontal axis and the vertical axis.

The following code snippet illustrates how to create a basic scatter chart:


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

For more information, see ScatterChart Example and Scatter Interactions Example.

成员类型

enum QScatterSeries::MarkerShape

This enum value describes the shape used when rendering marker items.

ConstantValueDescription
QScatterSeries::MarkerShapeCircle0The marker is a circle. This is the default value.
QScatterSeries::MarkerShapeRectangle1The marker is a rectangle.

属性

borderColor : QColor

This property holds the color used to draw the marker borders.

This is a convenience property for modifying the color of the pen.

访问函数:

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

Notifier signal:

void borderColorChanged(QColor color)

参见 QScatterSeries::pen().

brush : QBrush

This property holds the brush used to draw the scatter series markers.

The brush can be an image that can be created using QPainterPath, for example.

访问函数:

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

color : QColor

This property holds the color used to fill the series markers.

This is a convenience property for modifying the color of the brush.

访问函数:

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

Notifier signal:

void colorChanged(QColor color)

参见 QScatterSeries::brush().

markerShape : MarkerShape

This property holds the shape of the marker used to render the points in the series.

The default shape is MarkerShapeCircle.

访问函数:

MarkerShape markerShape() const
void setMarkerShape(MarkerShape shape)

Notifier signal:

void markerShapeChanged(MarkerShape shape)

参见 MarkerShape.

markerSize : qreal

This property holds the size of the marker used to render the points in the series.

The default size is 15.0.

访问函数:

qreal markerSize() const
void setMarkerSize(qreal size)

Notifier signal:

void markerSizeChanged(qreal size)

成员函数

QScatterSeries::QScatterSeries(QObject *parent = Q_NULLPTR)

Constructs a series object that is a child of parent.

QScatterSeries::~QScatterSeries()

Deletes the scatter series.

Note: Adding the series to QChart transfers the ownership to the chart.

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

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

Note: Notifier signal for property borderColor.

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

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

Note: Notifier signal for property color.

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

This signal is emitted when the marker shape changes to shape.

Note: Notifier signal for property markerShape.

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

This signal is emitted when the marker size changes to size.

Note: Notifier signal for property markerSize.

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

Reimplemented from QXYSeries::setBrush().

Note: Setter function for property brush.

参见 brush().

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

Reimplemented from QXYSeries::setPen().

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

Reimplemented from QAbstractSeries::type().