BarSet QML Type

Represents one set of bars in a bar graph. 更多...

import 语句: import QtGraphs
实例化: QBarSet
状态: 技术预览

特性

信号

方法

详细描述

条形集包含每个类别的一个数据值。假定集的第一个值属于第一个类别,第二个值属于第二个类别,依此类推。若集拥有的值少于类别,假定缺少值位于集末尾。对于集中间的缺少值,使用数值 0。0 值集标签不展示。

另请参阅 AbstractBarSeries and BarSeries .

特性文档编制

borderColor : color

The border color of the bar set.

borderWidth : real

By default, the width is -1, meaning the border width is defined by the theme.

color : color

The fill color of the bar set.

count : int [read-only]

The number of values in the bar set.

label : string

The label of the bar set.

labelColor : color

The text (label) color of the bar set.

selectedBars : list [read-only]

The indexes of the bars which are currently selected.

values : QVariantList

The values of the bar set. You can set a list of either real or point types as values.

If you set a list of real types as values, they directly define the bar set values.

If you set a list of point types 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 the value zero.

For example, the following bar sets have equal values:

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

信号文档编制

valueChanged ( int index )

This signal is emitted when the value at the position specified by index 被修改。

The corresponding signal handler is onValueChanged .

注意: 相应处理程序是 onValueChanged .

valuesAdded ( int index , int count )

This signal is emitted when new values are added to the bar set. index indicates the position of the first inserted value, and count is the number of inserted values.

The corresponding signal handler is onValuesAdded .

注意: 相应处理程序是 onValuesAdded .

valuesRemoved ( int index , int count )

This signal is emitted when values are removed from the bar set. index indicates the position of the first removed value, and count is the number of removed values.

The corresponding signal handler is onValuesRemoved .

注意: 相应处理程序是 onValuesRemoved .

方法文档编制

append ( real value )

Appends the new value specified by value to the end of the bar set.

at ( int index )

Returns the value specified by index from the bar set. If the index is out of bounds, 0.0 is returned.

remove ( int index , int count )

Removes the number of values specified by count from the bar set starting with the value specified by index .

If you leave out count , only the value specified by index is removed.

replace ( int index , real value )

Adds the value specified by value to the bar set at the position specified by index .