Qt 5.7 | Qt Charts | QML Types | XYSeries QML Type

Qt 5.7.1 Reference Documentation

# XYSeries QML Type

The XYSeries type is a base type for line, spline and scatter series. More...

Import Statement: | import QtCharts 2.1
Instantiates: | QXYSeries
Inherits: | AbstractSeries
Inherited By: | LineSeries, ScatterSeries, and SplineSeries

- List of all members, including inherited members

## Properties

- axisAngular : AbstractAxis
- axisRadial : AbstractAxis
- axisX : AbstractAxis
- axisXTop : AbstractAxis
- axisY : AbstractAxis
- axisYRight : AbstractAxis
- color : color
- pointLabelsClipping : bool
- pointLabelsColor : font
- pointLabelsFont : font
- pointLabelsFormat : string
- pointLabelsVisible : bool
- pointsVisible : bool

## Signals

- onClicked(QPointF point)
- onColorChanged(color color)
- onDoubleClicked(QPointF point)
- onHovered(point point, bool state)
- onPointAdded(int index)
- onPointLabelsClippingChanged(bool clipping)
- onPointLabelsColorChanged(Color color)
- onPointLabelsFontChanged(Font font)
- onPointLabelsFormatChanged(string format)
- onPointLabelsVisibilityChanged(bool visible)
- onPointRemoved(int index)
- onPointReplaced(int index)
- onPointsRemoved(int index, int count)
- onPointsReplaced()
- onPressed(QPointF point)
- onReleased(QPointF point)

## Methods

- append(real x, real y)
- QPointF at(int index)
- insert(int index, real x, real y)
- remove(int index)
- remove(real x, real y)
- removePoints(int index, int count)
- replace(real oldX, real oldY, real newX, real newY)

## Detailed Description

The XYSeries class is a base class for line, spline and scatter series. The class cannot be instantiated directly.

## Property Documentation

axisAngular : AbstractAxis

The angular axis used for the series, drawn around the polar chart view.

See also axisX.

axisRadial : AbstractAxis

The radial axis used for the series, drawn inside the polar chart view.

See also axisY.

axisX : AbstractAxis

The x axis used for the series. If you leave both axisX and axisXTop undefined, a ValueAxis is created for the series.

See also axisXTop.

axisXTop : AbstractAxis

The x axis used for the series, drawn on top of the chart view. Note that you can only provide either axisX or axisXTop, but not both.

See also axisX.

axisY : AbstractAxis

The y axis used for the series. If you leave both axisY and axisYRight undefined, a ValueAxis is created for the series.

See also axisYRight.

axisYRight : AbstractAxis

The y axis used for the series, drawn to the right on the chart view. Note that you can only provide either axisY or axisYRight, but not both.

See also axisY.

color : color

The color of the series. This is line (pen) color in case of LineSeries or SplineSeries and fill (brush) color in case of ScatterSeries or AreaSeries.

pointLabelsClipping : bool

Defines the clipping for data point labels. True by default. The labels on the edge of the plot area are cut when clipping is enabled.

See also pointLabelsVisible.

pointLabelsColor : font

Defines the color used for data point labels. By default, the color is the color of the brush defined in theme for labels.

See also pointLabelsFormat.

pointLabelsFont : font

Defines the font used for data point labels.

See also pointLabelsFormat.

pointLabelsFormat : string

The format used for showing labels with series points.

See also pointLabelsFormat, pointLabelsVisible, pointLabelsFont, and pointLabelsColor.

pointLabelsVisible : bool

Defines the visibility for data point labels.

See also pointLabelsFormat and pointLabelsClipping.

pointsVisible : bool

Controls if the data points are visible and should be drawn.

## Signal Documentation

onClicked(QPointF point)

Signal is emitted when user clicks the point on chart. The point is the point where the press was triggered. For example:

      LineSeries {
          XYPoint { x: 0; y: 0 }
          XYPoint { x: 1.1; y: 2.1 }
          onClicked: console.log("onClicked: " + point.x + ", " + point.y);
      }

See also onPressed, onReleased, and onDoubleClicked.

onColorChanged(color color)

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

onDoubleClicked(QPointF point)

Signal is emitted when user doubleclicks the point on chart. The point is the point where the first press was triggered. For example:

      LineSeries {
          XYPoint { x: 0; y: 0 }
          XYPoint { x: 1.1; y: 2.1 }
          onDoubleClicked: console.log("onDoubleClicked: " + point.x + ", " + point.y);
      }

See also onPressed, onReleased, and onClicked.

onHovered(point point, bool state)

This signal is emitted when user has hovered over or away from the series. point shows the origin (coordinate) of the hover event. state is true when user has hovered over the series and false when hover has moved away from the series.

onPointAdded(int index)

Signal is emitted when a point has been added at index.

onPointLabelsClippingChanged(bool clipping)

The clipping of the data point labels is changed to clipping.

onPointLabelsColorChanged(Color color)

The color used for data point labels is changed to color.

onPointLabelsFontChanged(Font font)

The font used for data point labels is changed to font.

onPointLabelsFormatChanged(string format)

Signal is emitted when the format of data point labels is changed.

onPointLabelsVisibilityChanged(bool visible)

The visibility of the data point labels is changed to visible.

onPointRemoved(int index)

Signal is emitted when a point has been removed from index.

onPointReplaced(int index)

Signal is emitted when a point has been replaced at index.

onPointsRemoved(int index, int count)

Signal is emitted when a count of points has been removed starting at index.

onPointsReplaced()

Signal is emitted when all points have been replaced with other points.

onPressed(QPointF point)

Signal is emitted when user presses the point on chart. For example:

      LineSeries {
          XYPoint { x: 0; y: 0 }
          XYPoint { x: 1.1; y: 2.1 }
          onPressed: console.log("onPressed: " + point.x + ", " + point.y);
      }

See also onClicked, onReleased, and onDoubleClicked.

onReleased(QPointF point)

Signal is emitted when user releases a press that was triggered on a point on chart. For example:

      LineSeries {
          XYPoint { x: 0; y: 0 }
          XYPoint { x: 1.1; y: 2.1 }
          onReleased: console.log("onReleased: " + point.x + ", " + point.y);
      }

See also onPressed, onClicked, and onDoubleClicked.

## Method Documentation

append(real x, real y)

Append point (x, y) to the series

QPointF at(int index)

Returns point at index. Returns (0, 0) if the index is not valid.

insert(int index, real x, real y)

Inserts point (x, y) to the index. If index is 0 or smaller than 0 the point is prepended to the list of points. If index is the same as or bigger than count, the point is appended to the list of points.

remove(int index)

Removes a point from the series at index.

remove(real x, real y)

Removes point (x, y) from the series. Does nothing, if point (x, y) does not exist.

removePoints(int index, int count)

Removes count points from the series starting at index.

replace(real oldX, real oldY, real newX, real newY)

Replaces point (oldX, oldY) with point (newX, newY). Does nothing, if point (oldX, oldY) does not exist.