QBoxPlotSeries Class | Qt Charts 5.7

Qt 5.7 | Qt Charts | C++ Classes | QBoxPlotSeries

Qt 5.7.1 Reference Documentation

# QBoxPlotSeries Class

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

Header: | #include <QBoxPlotSeries>
Instantiated By: | BoxPlotSeries
Inherits: | QAbstractSeries

- List of all members, including inherited members

## Properties

boxOutlineVisible : bool boxWidth : qreal brush : QBrush | count : const int pen : QPen

- 5 properties inherited from QAbstractSeries

## Public Functions

| QBoxPlotSeries(QObject *parent = Q_NULLPTR)
| ~QBoxPlotSeries()
bool | append(QBoxSet *set)
bool | append(QList<QBoxSet *> sets)
bool | boxOutlineVisible()
QList<QBoxSet *> | boxSets() const
qreal | boxWidth()
QBrush | brush() const
void | clear()
int | count() const
bool | insert(int index, QBoxSet *set)
QPen | pen() const
bool | remove(QBoxSet *set)
void | setBoxOutlineVisible(bool visible)
void | setBoxWidth(qreal width)
void | setBrush(const QBrush &brush)
void | setPen(const QPen &pen)
bool | take(QBoxSet *set)

## Reimplemented Public Functions

virtual QAbstractSeries::SeriesType | type() const

- 15 public functions inherited from QAbstractSeries

## Signals

void | boxOutlineVisibilityChanged()
void | boxWidthChanged()
void | boxsetsAdded(QList<QBoxSet *> sets)
void | boxsetsRemoved(QList<QBoxSet *> sets)
void | brushChanged()
void | clicked(QBoxSet *boxset)
void | countChanged()
void | doubleClicked(QBoxSet *boxset)
void | hovered(bool status, QBoxSet *boxset)
void | penChanged()
void | pressed(QBoxSet *boxset)
void | released(QBoxSet *boxset)

- 4 signals inherited from QAbstractSeries

## Detailed Description

Series for creating box-and-whiskers chart.

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

Note: The slot, each item in QBoxPlotSeries is drawn, represents a category in QBarCategoryAxis. 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.

See the box-and-whiskers chart example to learn how to create a box-and-whiskers chart.

See also QBoxSet and QBarCategoryAxis.

## Property Documentation

### boxOutlineVisible : bool

This property holds this property configures the visibility of the middle box outline.

Access functions:

bool | boxOutlineVisible()
void | setBoxOutlineVisible(bool visible)

Notifier signal:

void | boxOutlineVisibilityChanged()

### boxWidth : qreal

This property holds 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.

Access functions:

qreal | boxWidth()
void | setBoxWidth(qreal width)

Notifier signal:

void | boxWidthChanged()

### brush : QBrush

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

Access functions:

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

Notifier signal:

void | brushChanged()

### count : const int

This property holds the count of sets in series.

Access functions:

int | count() const

Notifier signal:

void | countChanged()

### pen : QPen

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

Access functions:

QPen | pen() const
void | setPen(const QPen &pen)

Notifier signal:

void | penChanged()

## Member Function Documentation

### QBoxPlotSeries::QBoxPlotSeries(QObject *parent = Q_NULLPTR)

Constructs empty QBoxPlotSeries. QBoxPlotSeries is QObject which is a child of a parent.

### QBoxPlotSeries::~QBoxPlotSeries()

Destructor. Removes series from chart.

### bool QBoxPlotSeries::append(QBoxSet *set)

Adds a single box and whiskers set to series. Takes ownership of the set. If the set is null or is already in series, it won't be appended. Returns true, if appending succeeded.

### bool QBoxPlotSeries::append(QList<QBoxSet *> sets)

Adds a list of boxsets to series. Takes ownership of the sets. Returns true, if all sets were appended successfully. If any of the sets is null or is already appended to series, nothing is appended and function returns false. If any of the sets is in list more than once, nothing is appended and function returns false.

### `[signal]` void QBoxPlotSeries::boxOutlineVisibilityChanged()

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

Note: Notifier signal for property boxOutlineVisible.

### QList<QBoxSet *> QBoxPlotSeries::boxSets() const

Returns a list of sets in series. Keeps ownership of sets.

### `[signal]` void QBoxPlotSeries::boxWidthChanged()

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

Note: Notifier signal for property boxWidth.

### `[signal]` void QBoxPlotSeries::boxsetsAdded(QList<QBoxSet *> sets)

Signal is emitted when a new sets of box-and-whiskers data is added to the series.

### `[signal]` void QBoxPlotSeries::boxsetsRemoved(QList<QBoxSet *> sets)

Signal is emitted when sets of box-and-whiskers data is removed from the series.

### `[signal]` void QBoxPlotSeries::brushChanged()

This signal is emitted when the brush of the box-and-whiskers has changed.

Note: Notifier signal for property brush.

See also brush.

### void QBoxPlotSeries::clear()

Removes all boxsets from the series. Deletes removed sets.

### `[signal]` void QBoxPlotSeries::clicked(QBoxSet *boxset)

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

### int QBoxPlotSeries::count() const

Returns number of sets in series.

Note: Getter function for property count.

### `[signal]` void QBoxPlotSeries::countChanged()

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

Note: Notifier signal for property count.

### `[signal]` void QBoxPlotSeries::doubleClicked(QBoxSet *boxset)

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

### `[signal]` void QBoxPlotSeries::hovered(bool status, QBoxSet *boxset)

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

### bool QBoxPlotSeries::insert(int index, QBoxSet *set)

Insert a box-and-whiskers set to the series at index postion. Takes ownership of the set. If the set is null or is already in series, it won't be appended. Returns true, if inserting succeeded.

### `[signal]` void QBoxPlotSeries::penChanged()

This signal is emitted when the pen of the box-and-whiskers has changed.

Note: Notifier signal for property pen.

See also brush.

### `[signal]` void QBoxPlotSeries::pressed(QBoxSet *boxset)

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

### `[signal]` void QBoxPlotSeries::released(QBoxSet *boxset)

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

### bool QBoxPlotSeries::remove(QBoxSet *set)

Removes boxset from the series. Deletes the set and returns true if successful.

### bool QBoxPlotSeries::take(QBoxSet *set)

Takes a single set from the series. Does not delete the boxset object.

NOTE: The series remains as the boxset's parent object. You must set the parent object to take full ownership.

Returns true if take was successful.

### `[virtual]` QAbstractSeries::SeriesType QBoxPlotSeries::type() const

Reimplemented from QAbstractSeries::type().

Returns type of series.

See also QAbstractSeries and SeriesType.