GraphsNode QML Type
Base type for 3D graphs. More...
| Import Statement: | import QtGraphs |
| Inherits: | |
| Inherited By: |
- List of all members, including inherited members
- GraphsNode is part of Qt Graphs QML Types for 3D.
Properties
- aspectRatio : real
- customItemList : list<Custom3DItem>
- gridLineType : enumeration
- horizontalAspectRatio : real
- labelMargin : real
- locale : locale
- margin : real
- optimizationHint : enumeration
- polar : bool
- queriedGraphPosition : vector3d
- radialLabelOffset : real
- selectedElement : enumeration
- selectionMode : enumeration
- theme : GraphsTheme
Methods
- qsizetype addCustomItem(Custom3DItem item)
- void clearSelection()
- void doPicking(QPoint point)
- void doRayPicking(QVector3D origin, QVector3D direction)
- bool hasSeries(Abstract3DSeries series)
- void releaseCustomItem(Custom3DItem item)
- void removeCustomItem(Custom3DItem item)
- void removeCustomItemAt(vector3d position)
- void removeCustomItems()
- Abstract3DAxis selectedAxis()
- Custom3DItem selectedCustomItem()
- qsizetype selectedCustomItemIndex()
- int selectedLabelIndex()
Detailed Description
The uncreatable base type for all 3D graph nodes in Qt Graphs.
See also Bars3DNode, Scatter3DNode, Surface3DNode, and Qt Graphs C++ Classes for 3D.
Property Documentation
aspectRatio : real
The ratio of the graph scaling between the longest axis on the horizontal plane and the y-axis. Defaults to 2.0.
Note: Has no effect on Bars3D.
See also horizontalAspectRatio.
customItemList : list<Custom3DItem>
The list of Custom3DItem items added to the graph. The graph takes ownership of the added items.
gridLineType : enumeration
Defines whether the grid lines type is Graphs3D.GridLineType.Shader or Graphs3D.GridLineType.Geometry.
This value affects all grid lines.
| Constant | Description |
|---|---|
Graphs3D.GridLineType.Shader | Grid lines are rendered with GPU in a shader. |
Graphs3D.GridLineType.Geometry | Grid lines are rendered with 3D models. |
See also Graphs3D.GridLineType.
horizontalAspectRatio : real
The ratio of the graph scaling between the x-axis and z-axis. The value of 0.0 indicates automatic scaling according to axis ranges. Defaults to 0.0.
Note: Has no effect on Bars3DNode, which handles scaling on the horizontal plane via the barThickness and barSpacing properties. Polar graphs also ignore this property.
See also aspectRatio, polar, Bars3DNode::barThickness, and Bars3DNode::barSpacing.
labelMargin : real
This property specifies the margin for the placement of the axis labels.
Negative values place the labels inside the plot-area while positive values place them outside the plot-area. Label automatic rotation is disabled when the value is negative. Defaults to 0.1
See also QAbstract3DAxis::labelAutoAngle.
locale : locale
Sets the locale used for formatting various numeric labels. Defaults to the "C" locale.
See also Value3DAxis::labelFormat.
margin : real
The absolute value used for the space left between the edge of the plottable graph area and the edge of the graph background.
If the margin value is negative, the margins are determined automatically and can vary according to the size of the items in the series and the type of the graph. The value is interpreted as a fraction of the y-axis range if the graph aspect ratios have not been changed from the default values. Defaults to -1.0.
Note: Setting a smaller margin for a scatter graph than the automatically determined margin can cause the scatter items at the edges of the graph to overlap with the graph background.
Note: On scatter and surface graphs, if the margin is small in comparison to the axis label size, the positions of the edge labels of the axes are adjusted to avoid overlap with the edge labels of the neighboring axes.
optimizationHint : enumeration
Specifies whether the default or legacy mode is used for rendering optimization.
The default mode uses instanced rendering, and provides the full feature set at the best level of performance on most systems. Legacy mode renders all items in the graph individually, without instancing. Use it only if the default mode does not work, that is, if the target system does not support instancing. Defaults to Default.
| Constant | Description |
|---|---|
Graphs3D.OptimizationHint.Default | Provides the full feature set with instancing at a good performance. |
Graphs3D.OptimizationHint.Legacy | Provides the full feature set at a reasonable performance. To be used if OptimizationHint.Default performs poorly or does not work. |
See also Abstract3DSeries::mesh and Graphs3D.OptimizationHint.
polar : bool
If true, the horizontal axes are changed into polar axes. The x-axis becomes the angular axis and the z-axis becomes the radial axis. Polar mode is not available for bar graphs.
Defaults to false.
See also radialLabelOffset.
queriedGraphPosition : vector3d [read-only]
This read-only property contains the latest graph position values along each axis queried using Scene3D::graphPositionQuery. The values are normalized to range [-1, 1]. If the queried position was outside the graph bounds, the values will not reflect the real position, but will instead be some undefined position outside the range [-1, 1]. The value will be undefined until a query is made.
There is no single correct 3D coordinate to match a particular screen position, so to be consistent, the queries are always done against the inner sides of an invisible box surrounding the graph.
Note: Bar graphs only allow querying graph position at the graph floor level, so the y-value is always zero for bar graphs and valid queries can be only made at screen positions that contain the floor of the graph.
See also Scene3D::graphPositionQuery.
radialLabelOffset : real
This property specifies the normalized horizontal offset for the axis labels of the radial polar axis. The value 0.0 indicates that the labels should be drawn next to the 0-angle angular axis grid line. The value 1.0 indicates that the labels are drawn in their usual place at the edge of the graph background. This property is ignored if the polar property value is false. Defaults to 1.0.
See also polar.
selectedElement : enumeration [read-only]
The element selected in the graph.
This property can be used to query the selected element type. The type is valid until a new selection is made in the graph and the selectedElementChanged signal is emitted.
The signal can be used for example for implementing customized input handling, as demonstrated by the Axis Handling example.
| Constant | Description |
|---|---|
Graphs3D.ElementType.None | No defined element. |
Graphs3D.ElementType.Series | An item in a series. |
Graphs3D.ElementType.AxisXLabel | The x-axis label. |
Graphs3D.ElementType.AxisYLabel | The y-axis label. |
Graphs3D.ElementType.AxisZLabel | The z-axis label. |
Graphs3D.ElementType.CustomItem | A custom item. |
See also selectedLabelIndex(), selectedAxis(), selectedCustomItemIndex(), selectedCustomItem(), Bars3DNode::selectedSeries, Scatter3DNode::selectedSeries, Scene3D::selectionQueryPosition, and Graphs3D.ElementType.
selectionMode : enumeration
The active selection mode in the graph. One of the Graphs3D.SelectionFlag enum values.
| Constant | Description |
|---|---|
Graphs3D.SelectionFlag.None | Selection mode disabled. |
Graphs3D.SelectionFlag.Item | Selection highlights a single item. |
Graphs3D.SelectionFlag.Row | Selection highlights a single row. |
Graphs3D.SelectionFlag.ItemAndRow | Combination flag for highlighting both item and row with different colors. |
Graphs3D.SelectionFlag.Column | Selection highlights a single column. |
Graphs3D.SelectionFlag.ItemAndColumn | Combination flag for highlighting both item and column with different colors. |
Graphs3D.SelectionFlag.RowAndColumn | Combination flag for highlighting both row and column. |
Graphs3D.SelectionFlag.ItemRowAndColumn | Combination flag for highlighting item, row, and column. |
Graphs3D.SelectionFlag.Slice | Setting this mode flag indicates that the graph should take care of the slice view handling automatically. If you wish to control the slice view yourself via Q3DScene, do not set this flag. When setting this mode flag, either Row or Column must also be set, but not both. Slicing is supported by Q3DBarsWidgetItem and Q3DSurfaceWidgetItem only. When this flag is set, slice mode is entered in the following situations:
|
Graphs3D.SelectionFlag.MultiSeries | Setting this mode means that items for all series at same position are highlighted, instead of just the selected item. The actual selection in the other series doesn't change. When setting this mode flag, one or more of the basic selection flags (Item, Row, or Column) must also be set. Multi-series selection is not supported for Q3DScatterWidgetItem. |
theme : GraphsTheme
The active theme of the graph.
See also GraphsTheme.
Method Documentation
qsizetype addCustomItem(Custom3DItem item)
Adds a Custom3DItem item to the graph. Graph takes ownership of the added item.
Returns the index to the added item if add was successful, -1 if trying to add a null item, and the index of the item if trying to add an already added item.
See also removeCustomItems(), removeCustomItem(), and removeCustomItemAt().
void clearSelection()
Clears selection from all attached series.
void doPicking(QPoint point)
Performs picking using view coordinates from point on the elements of the graph, selecting the first item hit. Default input handling performs this upon receiving the onTapped event.
See also selectedElement.
void doRayPicking(QVector3D origin, QVector3D direction)
Performs picking starting from origin and in direction on the elements of the graph, selecting the first item hit.
See also selectedElement.
bool hasSeries(Abstract3DSeries series)
Returns whether the series has already been added to the graph.
void releaseCustomItem(Custom3DItem item)
Gets ownership of item back and removes the item from the graph.
Note: If the same item is added back to the graph, the texture file needs to be re-set.
See also Custom3DItem::textureFile.
void removeCustomItem(Custom3DItem item)
Removes the custom item. Deletes the resources allocated to it.
void removeCustomItemAt(vector3d position)
Removes all custom items at position. Deletes the resources allocated to them.
void removeCustomItems()
Removes all custom items. Deletes the resources allocated to them.
Abstract3DAxis selectedAxis()
Can be used to get the selected axis after receiving selectedElementChanged signal with any label type. Selection is valid until the next selectedElementChanged signal.
Returns the selected axis, or null.
See also selectedElement.
Custom3DItem selectedCustomItem()
Can be used to get the selected custom item after receiving selectedElementChanged signal with ElementType.CustomItem type. Ownership of the item remains with the graph. Selection is valid until the next selectedElementChanged signal.
Returns the selected custom item, or null.
See also selectedElement.
qsizetype selectedCustomItemIndex()
Can be used to query the index of the selected custom item after receiving selectedElementChanged signal with ElementType.CustomItem type. Selection is valid until the next selectedElementChanged signal.
Returns the index of the selected custom item, or -1.
See also selectedElement.
int selectedLabelIndex()
Can be used to query the index of the selected label after receiving selectedElementChanged signal with any label type. Selection is valid until the next selectedElementChanged signal.
Returns the index of the selected label, or -1.
See also selectedElement.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.