BarSet QML Type

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

import 語句: import QtGraphs
在 C++: QBarSet

特性

信號

方法

詳細描述

條形集包含每個類彆的一個數據值。假定集的第 1 個值屬於第 1 個類彆,第 2 個值屬於第 2 個類彆,依此類推。若集擁有的值少於類彆,假定缺少值位於集末尾。對於集中間的缺少值,使用數值 0。0 值集標簽不展示。

另請參閱 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.

selectedColor : color

The fill color of the selected set.

: list < variant >

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)];
					

信號文檔編製

borderColorChanged ( color )

This signal is emitted when the border color of the bar set changes to color .

注意: 相應處理程序是 onBorderColorChanged .

borderWidthChanged ( real width )

This signal is emitted when the barset's border width changes. The new width is width .

注意: 相應處理程序是 onBorderWidthChanged .

colorChanged ( color )

This signal is emitted when the fill color of the bar set changes to color .

注意: 相應處理程序是 onColorChanged .

countChanged ()

This signal is emitted when the barset's value count changes.

注意: 相應處理程序是 onCountChanged .

labelChanged ()

This signal is emitted when the label of the bar set changes.

注意: 相應處理程序是 onLabelChanged .

另請參閱 label .

labelColorChanged ( color )

This signal is emitted when the text (label) color of the bar set changes to color .

注意: 相應處理程序是 onLabelColorChanged .

selectedBarsChanged ( list < int > indexes )

This signal is emitted when the selected bar changes. indexes is a list selected bar indexes.

注意: 相應處理程序是 onSelectedBarsChanged .

selectedColorChanged ( color color )

This signal is emitted when the selected bar color changes. The new color is color .

注意: 相應處理程序是 onSelectedColorChanged .

update ()

This signal is emitted when the barset is updated.

注意: 相應處理程序是 onUpdate .

updatedBars ()

This signal is emitted when the bars in this set are updated.

注意: 相應處理程序是 onUpdatedBars .

valueAdded ( 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.

注意: 相應處理程序是 onValueAdded .

valueChanged ( int index )

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

注意: 相應處理程序是 onValueChanged .

valueRemoved ( 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.

注意: 相應處理程序是 onValueRemoved .

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.

注意: 相應處理程序是 onValuesAdded .

valuesChanged ()

This signal is emitted when the values of the bar set change.

注意: 相應處理程序是 onValuesChanged .

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.

注意: 相應處理程序是 onValuesRemoved .

方法文檔編製

append ( list < real > values )

Appends the list of real values specified by values to the end of the bar set.

另請參閱 append().

append ( real value )

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

real at ( int index )

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

clear ()

Removes all values from the set.

int count ()

Returns the number of values in a bar set.

deselectAllBars ()

Deselects all bars in the set.

注意: Emits BarSet::selectedBarsChanged .

另請參閱 setBarSelected ().

deselectBar ( int index )

Deselects the bar at index .

注意: Emits BarSet::selectedBarsChanged .

另請參閱 setBarSelected ().

deselectBars ( list < int > indexes )

Marks multiple bars passed in an indexes list as deselected.

注意: Emits BarSet::selectedBarsChanged .

另請參閱 setBarSelected ().

insert ( int index , real value )

插入 value in the position specified by index . The values following the inserted value are moved up one position.

另請參閱 remove ().

bool isBarSelected ( int index )

返迴 true if the bar at the given index is among selected bars and false 否則。

注意: Selected bars are drawn using the selected color if it was specified using BarSet::setSelectedColor.

另請參閱 selectedBars , setBarSelected (),和 selectedColor .

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 .

selectAllBars ()

Marks all bars in the set as selected.

注意: Emits BarSet::selectedBarsChanged .

另請參閱 setBarSelected ().

selectBar ( int index )

Marks the bar at index as selected.

注意: Emits BarSet::selectedBarsChanged .

另請參閱 setBarSelected ().

selectBars ( list < int > indexes )

Marks multiple bars passed in an indexes list as selected.

注意: Emits BarSet::selectedBarsChanged .

另請參閱 setBarSelected ().

setBarSelected ( int index , bool selected )

Marks the bar at index as either selected or deselected as specified by selected .

注意: Selected bars are drawn using the selected color if it was specified. Emits BarSet::selectedBarsChanged .

另請參閱 isBarSelected () 和 selectedColor .

real sum ()

Returns the sum of all values in the bar set.

toggleSelection ( list < int > indexes )

Changes the selection state of bars at the given indexes to the opposite one.

注意: Emits BarSet::selectedBarsChanged .

另請參閱 setBarSelected ().