Qt 5.7 | Qt Charts | QML Types | BarSet QML Type

Qt 5.7.1 Reference Documentation

# BarSet QML Type

Building block for different bar charts. More...

Import Statement: | import QtCharts 2.1
Instantiates: | QBarSet

- List of all members, including inherited members

## Properties

- borderColor : color
- borderWidth : real
- brushFilename : QString
- color : color
- count : int
- label : string
- labelColor : color
- labelFont : Font
- values : QVariantList

## Signals

- onBorderColorChanged(color color)
- onColorChanged(color color)
- onLabelChanged()
- onLabelColorChanged(color color)
- onValueChanged(int index)
- onValuesAdded(int index, int count)
- onValuesRemoved(int index, int count)

## Detailed Description

BarSet represents one set of bars. Set of bars contains one data value for each category. First value of set is assumed to belong to first category, second to second category and so on. If set has fewer values than there are categories, then the missing values are assumed to be at the end of set. For missing values in middle of a set, numerical value of zero is used. Labels for zero value sets are not shown.

See also AbstractBarSeries, BarSeries, StackedBarSeries, and PercentBarSeries.

## Property Documentation

borderColor : color

The line (pen) color of the bar set.

borderWidth : real

The width of the border line. By default the width is 2.0.

brushFilename : QString

The name of the file used as a brush for the set.

color : color

The fill (brush) color of the bar set.

count : int

The count of values on the bar set

label : string

Defines the label of the bar set.

labelColor : color

The text (label) color of the bar set.

labelFont : Font

Defines the font used by the bar set's label.

See the Qt documentation for more details of Font.

values : QVariantList

The values of the bar set. You can set either a list of reals or a list of points as values.

If you set a list of reals as values, the values directly define the bar set values.

If you set a list of points as values, the x-coordinate of the point specifies its zero-based index in the bar set. The size of the bar set is the highest x-coordinate value + 1. If a point is missing for any x-coordinate between zero and the highest value, it gets value zero.

For example the following sets have equal values:

      myBarSet1.values = [5, 0, 1, 5];
      myBarSet2.values = [Qt.point(0, 5), Qt.point(2, 1), Qt.point(3, 5)];

## Signal Documentation

onBorderColorChanged(color color)

This signal is emitted when the line (pen) color of the set has changed to color.

onColorChanged(color color)

This signal is emitted when the fill (brush) color of the set has changed to color.

onLabelChanged()

This signal is emitted when the label of the bar set has changed.

onLabelColorChanged(color color)

This signal is emitted when the text (label) color of the set has changed to color.

onValueChanged(int index)

This signal is emitted values the value in the set has been modified. Parameter index indicates the position of the modified value.

onValuesAdded(int index, int count)

This signal is emitted when new values have been added to the set. Parameter index indicates the position of the first inserted value. Parameter count is the number of inserted values.

onValuesRemoved(int index, int count)

This signal is emitted values have been removed from the set. Parameter index indicates the position of the first removed value. Parameter count is the number of removed values.