BoxPlotSeries QML Type | Qt Charts 5.7

Qt 5.7 | Qt Charts | QML Types | BoxPlotSeries QML Type

Qt 5.7.1 Reference Documentation

# BoxPlotSeries QML Type

Series for creating box-and-whiskers chart. More...

Import Statement: | import QtCharts 2.1
Instantiates: | QBoxPlotSeries
Inherits: | AbstractSeries

- List of all members, including inherited members

## Properties

- axisX : AbstractAxis
- axisXTop : AbstractAxis
- axisY : AbstractAxis
- axisYRight : AbstractAxis
- boxOutlineVisible : bool
- boxWidth : qreal
- brush : Brush
- count : int
- pen : Pen

## Signals

- onAxisXChanged(AbstractAxis axis)
- onAxisXTopChanged(AbstractAxis axis)
- onAxisYChanged(AbstractAxis axis)
- onAxisYRightChanged(AbstractAxis axis)
- onBoxOutlineVisibilityChanged()
- onBoxWidthChanged()
- onBoxsetsAdded()
- onBoxsetsRemoved()
- onBrushChanged()
- onClicked(BoxSet boxset)
- onCountChanged()
- onDoubleClicked(BoxSet boxset)
- onHovered(bool status, BoxSet boxset)
- onPenChanged()
- onPressed(BoxSet boxset)
- onReleased(BoxSet boxset)

## Methods

- append(BoxSet box)
- append(string label, VariantList values)
- clear()
- insert(int index, string label, VariantList values)
- remove(QBoxSet boxset)

## Detailed Description

BoxPlotSeries represents a series of data shown as box-and-whiskers bars. The purpose of this class is to act as a container for single box-and-whiskers items. Each item is drawn to own slot. If chart includes multiple instances of BoxPlotSeries then box-and-whiskers items with the same index are drawn to same slot.

Note: The slot, each item in BoxPlotSeries is drawn, represents a category in BarCategoryAxis. The category labels have to be unique. If same category label is defined for several box-and-whisker items only the first one is drawn.

The following QML shows how to create a simple box-and-whiskers chart:

      import QtQuick 2.0
      import QtCharts 2.0

      ChartView {
          title: "Box Plot series"
          width: 400
          height: 300
          theme: ChartView.ChartThemeBrownSand
          legend.alignment: Qt.AlignBottom

          BoxPlotSeries {
              id: plotSeries
              name: "Income"
              BoxSet { label: "Jan"; values: [3, 4, 5.1, 6.2, 8.5] }
              BoxSet { label: "Feb"; values: [5, 6, 7.5, 8.6, 11.8] }
              BoxSet { label: "Mar"; values: [3.2, 5, 5.7, 8, 9.2] }
              BoxSet { label: "Apr"; values: [3.8, 5, 6.4, 7, 8] }
              BoxSet { label: "May"; values: [4, 5, 5.2, 6, 7] }
          }
      }

See also BoxSet and BarCategoryAxis.

## Property Documentation

axisX : AbstractAxis

The x axis used for the series. If you leave both axisX and axisXTop undefined, a BarCategoriesAxis 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.

boxOutlineVisible : bool

This property configures the visibility of the middle box outline.

boxWidth : qreal

This property configures the width of the box-and-whiskers item. The value signifies the relative width of the box-and-whiskers item inside its own slot. The value can between 0.0 and 1.0. Negative values are clamped to 0.0 and values over 1.0 are clamped to 1.0.

brush : Brush

This property configures the brush of the box-and-whiskers items.

count : int

The count of sets in series.

pen : Pen

This property configures the pen of the box-and-whiskers items.

## Signal Documentation

onAxisXChanged(AbstractAxis axis)

Signal is emitted when there is change in X axis.

onAxisXTopChanged(AbstractAxis axis)

Signal is emitted when there is change in top X axis.

onAxisYChanged(AbstractAxis axis)

Signal is emitted when there is change in Y axis.

onAxisYRightChanged(AbstractAxis axis)

Signal is emitted when there is change in Y right axis.

onBoxOutlineVisibilityChanged()

Signal is emitted when the middle box outline visibility is changed.

onBoxWidthChanged()

Signal is emitted when the width of the box-and-whiskers item is changed.

onBoxsetsAdded()

Signal is emitted when new box-and-whiskers sets are added to the series.

onBoxsetsRemoved()

Signal is emitted when new box-and-whiskers sets are removed from the series.

onBrushChanged()

Signal is emitted when the brush for box-and-whiskers items has changed.

onClicked(BoxSet boxset)

Signal is emitted when the user clicks the boxset on the chart.

onCountChanged()

Signal is emitted when there is change in count of box-and-whiskers items in the series.

onDoubleClicked(BoxSet boxset)

This signal is emitted when the user doubleclicks the boxset on the chart.

onHovered(bool status, BoxSet boxset)

Signal is emitted when there is change in hover status over boxset.

onPenChanged()

Signal is emitted when the pen for box-and-whiskers items has changed.

onPressed(BoxSet boxset)

This signal is emitted when the user presses the boxset on the chart.

onReleased(BoxSet boxset)

This signal is emitted when the user releases the boxset on the chart.

## Method Documentation

append(BoxSet box)

Appends the box to the series.

append(string label, VariantList values)

Appends a new box-and-whiskers set with label and values to the series.

clear()

Removes all boxsets from the series. Deletes removed sets.

insert(int index, string label, VariantList values)

Inserts a new box-and-whiskers set with label and values at the index position.

remove(QBoxSet boxset)

Removes the boxset from the series.