PySide6.QtGraphsWidgets.Q3DBarsWidgetItem¶
- class Q3DBarsWidgetItem¶
- The - Q3DBarsWidgetItemclass provides methods for rendering 3D bar graphs. More…- Synopsis¶- Properties¶- barSeriesMarginᅟ- Margin between series columns in X and Z dimensions. Sensible values are on the range [0,1)
- barSpacingᅟ- Bar spacing in the X and Z dimensions
- barSpacingRelativeᅟ- Whether spacing is absolute or relative to bar thickness
- barThicknessᅟ- Bar thickness ratio between the X and Z dimensions
- columnAxisᅟ- Axis attached to the active column
- floorLevelᅟ- Floor level for the bar graph in Y-axis data coordinates
- multiSeriesUniformᅟ- Whether bars are to be scaled with proportions set to a single series bar even if there are multiple series displayed
- primarySeriesᅟ- Primary series of the graph
- rowAxisᅟ- Axis attached to the active row
- selectedSeriesᅟ- Selected series or a null value
 - Methods¶- def - __init__()
- def - addAxis()
- def - addSeries()
- def - axes()
- def - barSpacing()
- def - barThickness()
- def - columnAxis()
- def - floorLevel()
- def - insertSeries()
- def - primarySeries()
- def - releaseAxis()
- def - removeSeries()
- def - rowAxis()
- def - selectedSeries()
- def - seriesList()
- def - setBarSpacing()
- def - setColumnAxis()
- def - setFloorLevel()
- def - setRowAxis()
- def - setValueAxis()
- def - valueAxis()
 - Signals¶- Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Detailed Description¶- Warning - This section contains snippets that were automatically translated from C++ to Python and may contain errors. - This class enables developers to render 3D bar graphs and view them by freely rotating the scene. Rotation is achieved by holding down the right mouse button and moving the mouse, while zooming is accomplished using the mouse wheel. If enabled, selection is performed with the left mouse button. The scene can be reset to the default camera view by clicking the mouse wheel. On touch devices, rotation is achieved by tap-and-move, selection by tap-and-hold, and zooming by pinch. - If no axes are set explicitly for - Q3DBarsWidgetItem, temporary default axes without labels are created. These default axes can be modified via axis accessors, but as soon as any axis is set explicitly for the orientation, the default axis for that orientation is destroyed.- Q3DBarsWidgetItemsupports more than one visible series at the same time. All series don’t need to have the same number of rows and columns. Row and column labels are taken from the first added series unless explicitly defined for row and column axes.- Q3DBarsWidgetItemhas transparency support. This feature allows you to adjust the opacity of the bars, making them partially see-through, fully transparent, or opaque.- How to construct a minimal Q3DBarsWidgetItem graph¶- First, construct an instance of - Q3DBarsWidgetItem:- quickWidget = QQuickWidget() bars = Q3DBarsWidgetItem() bars.setWidget(quickWidget) bars.widget().setMinimumSize(QSize(256, 256)) - After constructing - Q3DBarsWidgetItem, you can set the data window by changing the range on the row and column axes. It is not mandatory, as the data window will default to showing all of the data in the series. If the amount of data is large, it is usually preferable to show just a portion of it. For example, let’s set the data window to display the first five rows and columns:- bars.rowAxis().setRange(0, 4) bars.columnAxis().setRange(0, 4) - Now, - Q3DBarsWidgetItemis ready to receive data to be rendered. Create a series with one row of 5 values:- series = QBar3DSeries() data = QBarDataRow() data << QBarDataItem(1.0f) << QBarDataItem(3.0f) << QBarDataItem(7.5f) << QBarDataItem(5.0f) << QBarDataItem(2.2f) series.dataProxy().addRow(data) bars.addSeries(series) - Note - We set the data window to 5 x 5, but we are adding only one row of data. This is okay; the rest of the rows will just be blank. - Finally you will need to set it visible: - bars.widget().show() - The complete code needed to create and display this graph is: - if __name__ == "__main__": app = QApplication([]) quickWidget = QQuickWidget() bars = Q3DBarsWidgetItem() bars.setWidget(quickWidget) bars.widget().setMinimumSize(QSize(256, 256)) bars.rowAxis().setRange(0, 4) bars.columnAxis().setRange(0, 4) series = QBar3DSeries() data = QBarDataRow() data << QBarDataItem(1.0f) << QBarDataItem(3.0f) << QBarDataItem(7.5f) << QBarDataItem(5.0f) << QBarDataItem(2.2f) series.dataProxy().addRow(data) bars.addSeries(series) bars.widget().show() sys.exit(app.exec()) - And this is what those few lines of code produce:   - The scene can be rotated, zoomed into, and a bar can be selected to view its value, but no other interactions are included in this minimal code example. You can learn more by familiarizing yourself with the examples provided, like the Simple Bar Graph . - Note - Properties can be used directly when - from __feature__ import true_propertyis used or via accessor functions otherwise.- This property holds Margin between series columns in X and Z dimensions. Sensible values are on the range [0,1).. - Preset to - (0.0, 0.0)by default. This property enables showing bars from different series side by side, but with space between columns.- See also - Access functions:
 - This property holds Bar spacing in the X and Z dimensions.. - Preset to - (1.0, 1.0)by default. Spacing is affected by the- barSpacingRelativeproperty.- See also - barSpacingRelative- multiSeriesUniform- barSeriesMargin- Access functions:
 - property barSpacingRelativeᅟ: bool¶
 - This property holds Whether spacing is absolute or relative to bar thickness.. - If it is - true, the value of- 0.0means that the bars are placed side-to-side,- 1.0means that a space as wide as the thickness of one bar is left between the bars, and so on. Preset to- true.- Access functions:
 - property barThicknessᅟ: float¶
 - This property holds The bar thickness ratio between the X and Z dimensions.. - The value - 1.0means that the bars are as wide as they are deep, whereas- 0.5makes them twice as deep as they are wide. Preset to- 1.0by default.- Access functions:
 - property columnAxisᅟ: QCategory3DAxis¶
 - This property holds The axis attached to the active column.. - Sets the axis of the active column to - axis. Implicitly calls- addAxis()to transfer the ownership of the axis to this graph.- If - axisis null, a temporary default axis with no labels is created. This temporary axis is destroyed if another axis is set explicitly to the same orientation.- See also - Access functions:
 - property floorLevelᅟ: float¶
 - This property holds The floor level for the bar graph in Y-axis data coordinates.. - The actual floor level will be restricted by the Y-axis minimum and maximum values. Defaults to zero. - Access functions:
 - property multiSeriesUniformᅟ: bool¶
 - This property holds Whether bars are to be scaled with proportions set to a single series bar even if there are multiple series displayed.. - If set to - true,- bar spacingwill be correctly applied only to the X-axis. Preset to- falseby default.- Access functions:
 - property primarySeriesᅟ: QBar3DSeries¶
 - This property holds The primary series of the graph.. - Sets - seriesas the primary series of the graph. The primary series determines the row and column axis labels when the labels are not explicitly set to the axes.- If the specified series is not yet added to the graph, setting it as the primary series will also implicitly add it to the graph. - If the primary series itself is removed from the graph, this property resets to default. - If - seriesis null, this property resets to default. Defaults to the first added series or zero if no series are added to the graph.- Access functions:
 - property rowAxisᅟ: QCategory3DAxis¶
 - This property holds The axis attached to the active row.. - Sets the axis of the active row to - axis. Implicitly calls- addAxis()to transfer the ownership of the axis to this graph.- If - axisis null, a temporary default axis with no labels is created. This temporary axis is destroyed if another axis is set explicitly to the same orientation.- See also - Access functions:
 - property selectedSeriesᅟ: QBar3DSeries¶
 - This property holds The selected series or a null value.. - If selectionMode has the - SelectionMultiSeriesflag set, this property holds the series that owns the selected bar.- Access functions:
 - property valueAxisᅟ: QValue3DAxis¶
 - Sets the active value axis (the Y-axis) to - axis. Implicitly calls- addAxis()to transfer the ownership of- axisto this graph.- If - axisis null, a temporary default axis with no labels and an automatically adjusting range is created. This temporary axis is destroyed if another axis is set explicitly to the same orientation.- See also - Access functions:
 - Constructs a new 3D bar graph with the optional - parent.- addAxis(axis)¶
- Parameters:
- axis – - QAbstract3DAxis
 
 - Adds - axisto the graph. The axes added via addAxis are not yet taken to use, addAxis is simply used to give the ownership of the- axisto the graph. The- axismust not be null or added to another graph.- addSeries(series)¶
- Parameters:
- series – - QBar3DSeries
 
 - Adds the - seriesto the graph. A graph can contain multiple series, but only one set of axes, so the rows and columns of all series must match for the visualized data to be meaningful. If the graph has multiple visible series, only the primary series will generate the row or column labels on the axes in cases where the labels are not explicitly set for the axes. If the newly added series has specified a selected bar, it will be highlighted and any existing selection will be cleared. Only one added series can have an active selection.- See also - axes()¶
- Return type:
- .list of QAbstract3DAxis 
 
 - Returns the list of all added axes. - See also - barSeriesMargin()¶
- Return type:
 - See also 
 - Getter of property - barSeriesMarginᅟ.- Notification signal of property - barSeriesMarginᅟ.- barSpacing()¶
- Return type:
 - See also 
 - Getter of property - barSpacingᅟ.- Notification signal of property - barSpacingᅟ.- barSpacingRelativeChanged(relative)¶
- Parameters:
- relative – bool 
 
 - Notification signal of property - barSpacingRelativeᅟ.- barThickness()¶
- Return type:
- float 
 - See also 
 - Getter of property - barThicknessᅟ.- barThicknessChanged(thicknessRatio)¶
- Parameters:
- thicknessRatio – float 
 
 - Notification signal of property - barThicknessᅟ.- columnAxis()¶
- Return type:
 - See also 
 - Getter of property - columnAxisᅟ.- columnAxisChanged(axis)¶
- Parameters:
- axis – - QCategory3DAxis
 
 - Notification signal of property - columnAxisᅟ.- floorLevel()¶
- Return type:
- float 
 - See also 
 - Getter of property - floorLevelᅟ.- floorLevelChanged(level)¶
- Parameters:
- level – float 
 
 - Notification signal of property - floorLevelᅟ.- insertSeries(index, series)¶
- Parameters:
- index – int 
- series – - QBar3DSeries
 
 
 - Inserts the - seriesinto the position- indexin the series list. If the- serieshas already been added to the list, it is moved to the new- index.- Note - When moving a series to a new - indexthat is after its old index, the new position in the list is calculated as if the series was still in its old index, so the final index is actually the- indexdecremented by one.- See also - isBarSpacingRelative()¶
- Return type:
- bool 
 
 - Getter of property - barSpacingRelativeᅟ.- isMultiSeriesUniform()¶
- Return type:
- bool 
 
 - Getter of property - multiSeriesUniformᅟ.- multiSeriesUniformChanged(uniform)¶
- Parameters:
- uniform – bool 
 
 - Notification signal of property - multiSeriesUniformᅟ.- primarySeries()¶
- Return type:
 - See also 
 - Getter of property - primarySeriesᅟ.- primarySeriesChanged(series)¶
- Parameters:
- series – - QBar3DSeries
 
 - Notification signal of property - primarySeriesᅟ.- releaseAxis(axis)¶
- Parameters:
- axis – - QAbstract3DAxis
 
 - Releases the ownership of the - axisback to the caller, if it is added to this graph. If the released- axisis in use, a new default axis will be created and set active.- If the default axis is released and added back later, it behaves as any other axis would. - removeSeries(series)¶
- Parameters:
- series – - QBar3DSeries
 
 - Removes the - seriesfrom the graph.- See also - rowAxis()¶
- Return type:
 - See also 
 - Getter of property - rowAxisᅟ.- rowAxisChanged(axis)¶
- Parameters:
- axis – - QCategory3DAxis
 
 - Notification signal of property - rowAxisᅟ.- selectedSeries()¶
- Return type:
 
 - Getter of property - selectedSeriesᅟ.- selectedSeriesChanged(series)¶
- Parameters:
- series – - QBar3DSeries
 
 - Notification signal of property - selectedSeriesᅟ.- seriesList()¶
- Return type:
- .list of QBar3DSeries 
 
 - Returns the list of series added to this graph. - See also - Setter of property - barSeriesMarginᅟ.- Setter of property - barSpacingᅟ.- setBarSpacingRelative(relative)¶
- Parameters:
- relative – bool 
 - See also 
 - Setter of property - barSpacingRelativeᅟ.- setBarThickness(thicknessRatio)¶
- Parameters:
- thicknessRatio – float 
 - See also 
 - Setter of property - barThicknessᅟ.- setColumnAxis(axis)¶
- Parameters:
- axis – - QCategory3DAxis
 - See also 
 - Setter of property - columnAxisᅟ.- setFloorLevel(level)¶
- Parameters:
- level – float 
 - See also 
 - Setter of property - floorLevelᅟ.- setMultiSeriesUniform(uniform)¶
- Parameters:
- uniform – bool 
 - See also 
 - Setter of property - multiSeriesUniformᅟ.- setPrimarySeries(series)¶
- Parameters:
- series – - QBar3DSeries
 - See also 
 - Setter of property - primarySeriesᅟ.- setRowAxis(axis)¶
- Parameters:
- axis – - QCategory3DAxis
 - See also 
 - Setter of property - rowAxisᅟ.- setValueAxis(axis)¶
- Parameters:
- axis – - QValue3DAxis
 - See also 
 - Setter of property - valueAxisᅟ.- valueAxis()¶
- Return type:
 - See also 
 - Getter of property - valueAxisᅟ.- valueAxisChanged(axis)¶
- Parameters:
- axis – - QValue3DAxis
 
 - Notification signal of property - valueAxisᅟ.