PySide6.QtGraphs.QGraphsTheme¶
- class QGraphsTheme¶
- QGraphsThemeclass provides a visual style for graphs. More…- Added in version 6.8. - Synopsis¶- Properties¶
- axisXLabelFontᅟ- Font to be used for labels on x axis
- axisYLabelFontᅟ- Font to be used for labels on y axis
- axisZLabelFontᅟ- Font to be used for labels on z axis
- backgroundColorᅟ- Color of the view the graph is drawn into. The default value depends on colorScheme
- backgroundVisibleᅟ- Whether the background is visible
- borderColorsᅟ- List of border colors to be used for all the objects in the graph, series by series
- borderWidthᅟ- Width of borders in graph if any The default value is 1.0
- gridVisibleᅟ- Whether the grid lines are drawn
- labelBackgroundColorᅟ- Color of the label backgrounds
- labelBackgroundVisibleᅟ- Whether the label is drawn with a color background or with a fully transparent background
- labelBorderVisibleᅟ- Whether label borders are drawn for labels that have a background
- labelFontᅟ- Font to be used for labels
- labelTextColorᅟ- Color of the font used for labels
- labelsVisibleᅟ- Whether labels are drawn at all
- multiHighlightColorᅟ- Highlight color for selected objects
- plotAreaBackgroundColorᅟ- Color of the graph plot area background. The default value depends on colorScheme
- plotAreaBackgroundVisibleᅟ- Whether the plot area background is visible
- seriesColorsᅟ- List of base colors to be used for all the objects in the graph, series by series
- singleHighlightColorᅟ- Highlight color for a selected object
 - Methods¶- def - __init__()
- def - axisX()
- def - axisXLabelFont()
- def - axisY()
- def - axisYLabelFont()
- def - axisZ()
- def - axisZLabelFont()
- def - borderColors()
- def - borderWidth()
- def - colorScheme()
- def - colorStyle()
- def - dirtyBits()
- def - grid()
- def - isGridVisible()
- def - labelFont()
- def - labelTextColor()
- def - labelsVisible()
- def - resetDirtyBits()
- def - seriesColors()
- def - setAxisX()
- def - setAxisY()
- def - setAxisZ()
- def - setBorderWidth()
- def - setColorScheme()
- def - setColorStyle()
- def - setGrid()
- def - setGridVisible()
- def - setLabelFont()
- def - setTheme()
- def - theme()
- def - themeDirty()
 - Slots¶- Signals¶- def - axisXChanged()
- def - axisYChanged()
- def - axisZChanged()
- def - gridChanged()
- def - themeChanged()
- def - update()
 - 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. - Specifies visual properties that affect the whole graph. There are several built-in themes that can be used as is or modified freely. - Themes can be created from scratch using the - UserDefinedenum value. Creating a theme using the default constructor produces a new user-defined theme.- Customizing Theme¶- The default theme is - QtGreen, but it is possible to customize each property.- The following table lists the properties controlled by a theme and the default values for - UserDefined.- Property - Default Value - backgroundVisible- true- Qt::black - QLinearGradient. Essentially fully black. - Uniform - QFont - gridVisible- true- labelBackgroundVisible- true- labelBorderVisible- true- true- Usage Examples¶- Creating a built-in theme without any modifications: - theme = QGraphsTheme() - Creating a built-in theme and modifying some properties: - theme = QGraphsTheme() theme.setBackgroundVisible(False) theme.setLabelBackgroundVisible(False) - Modifying a user-defined theme. The theme has been created the same way it was in the previous snippets: - theme.setTheme(QGraphsTheme.Theme.UserDefined) theme.setBackgroundColor(QColor(QRgb(0x99ca53))) theme.setBackgroundVisible(True) colors = { QColor(QRgb(0x209fdf)) } theme.setSeriesColors(colors) theme.setColorStyle(QGraphsTheme.ColorStyle.Uniform) theme.setLabelFont(QFont("Impact", 35)) theme.setGridVisible(True) gridline = theme.grid() gridline.setMainColor(QColor(QRgb(0x99ca53))) theme.setGrid(gridline) theme.setLabelBackgroundColor(QColor(0xf6, 0xa6, 0x25, 0xa0)) theme.setLabelBackgroundVisible(True) theme.setLabelBorderVisible(True) theme.setLabelTextColor(QColor(QRgb(0x404044))) theme.setMultiHighlightColor(QColor(QRgb(0x6d5fd5))) theme.setSingleHighlightColor(QColor(QRgb(0xf6a625))) theme.setBackgroundColor(QColor(QRgb(0xffffff))) - Modifying some properties after theme has been set to a graph: - quickWidget = QQuickWidget() bars = Q3DBarsWidgetItem() bars.setWidget(quickWidget) bars.widget().setMinimumSize(QSize(512, 512)) bars.activeTheme().setTheme(QGraphsTheme.Theme.MixSeries) color = { QColor(Qt.red) } bars.activeTheme().setSeriesColors(color) bars.activeTheme().setSingleHighlightColor(Qt.yellow) - class Theme¶
- Built-in themes. - Constant - Description - QGraphsTheme.Theme.QtGreen - A light theme with green as the base color. - QGraphsTheme.Theme.QtGreenNeon - A light theme with green neon as the base color. - QGraphsTheme.Theme.MixSeries - A mixed theme with various colors. - QGraphsTheme.Theme.OrangeSeries - A theme with Orange as the base color. - QGraphsTheme.Theme.YellowSeries - A theme with Yellow as the base color. - QGraphsTheme.Theme.BlueSeries - A theme with Blue as the base color. - QGraphsTheme.Theme.PurpleSeries - A theme with Purple as the base color. - QGraphsTheme.Theme.GreySeries - A theme with Grey as the base color. - QGraphsTheme.Theme.UserDefined - A user-defined theme. For more information, see - Customizing Theme.
 - class ColorStyle¶
- Gradient types. - Constant - Description - QGraphsTheme.ColorStyle.Uniform - Objects are rendered in a single color. The color used is specified in - seriesColors,- singleHighlightColorand- multiHighlightColorproperties.- QGraphsTheme.ColorStyle.ObjectGradient - Objects are colored using a full gradient for each object regardless of object height. The gradient used is specified in - seriesGradients,- singleHighlightGradientand- multiHighlightGradientproperties.- QGraphsTheme.ColorStyle.RangeGradient - Objects are colored using a portion of the full gradient determined by the object’s height and its position on the Y-axis. The gradient used is specified in - seriesGradients,- singleHighlightGradientand- multiHighlightGradientproperties.
 - class ForceTheme¶
 - class ColorScheme¶
- Represents the color scheme of the graph. - Constant - Description - QGraphsTheme.ColorScheme.Automatic - The background colors follow the platform color scheme if available. If unavailable, the Light appearance is used. - QGraphsTheme.ColorScheme.Light - The background colors are lighter than the text color, i.e. the theme is light. - QGraphsTheme.ColorScheme.Dark - The background colors are darker than the text color, i.e. the theme is dark. - See also - ColorScheme
 - class GradientQMLStyle¶
 - Note - Properties can be used directly when - from __feature__ import true_propertyis used or via accessor functions otherwise.- property axisXᅟ: QGraphsLine¶
 - Access functions:
- Signal - axisXChanged()
 
 - This property holds The font to be used for labels on x axis.. - Access functions:
 - property axisYᅟ: QGraphsLine¶
 - Access functions:
- Signal - axisYChanged()
 
 - This property holds The font to be used for labels on y axis.. - Access functions:
 - property axisZᅟ: QGraphsLine¶
 - Access functions:
- Signal - axisZChanged()
 
 - This property holds The font to be used for labels on z axis.. - Access functions:
 - This property holds The color of the view the graph is drawn into. The default value depends on - colorScheme..- Access functions:
 - property backgroundVisibleᅟ: bool¶
 - This property holds Whether the background is visible.. - The background is drawn by using the value of - backgroundColor. The default value is- true.- Access functions:
 - property borderColorsᅟ: list of QColor¶
 - This property holds The list of border colors to be used for all the objects in the graph, series by series.. - If there are more series than colors, the color list wraps and starts again with the first color in the list. - Has no immediate effect if - colorStyleis not Uniform.- Access functions:
 - property borderWidthᅟ: float¶
 - This property holds The width of borders in graph if any The default value is - 1.0..- Access functions:
 - property colorSchemeᅟ: QGraphsTheme.ColorScheme¶
 - The color scheme of the graph in use. - See also - ColorScheme- Access functions:
 - property colorStyleᅟ: QGraphsTheme.ColorStyle¶
 - The style of the graph colors. One of - ColorStyleenum values.- This value can be overridden by setting Abstract3DSeries.colorStyle explicitly in the series. - Access functions:
 - property gridᅟ: QGraphsLine¶
 - Access functions:
- Signal - gridChanged()
 
 - property gridVisibleᅟ: bool¶
 - This property holds Whether the grid lines are drawn.. - This value affects all grid lines. The default value is - true.- Access functions:
 - This property holds The color of the label backgrounds.. - Has no effect if - labelBackgroundVisibleis- false. The default value depends on- colorScheme.- Access functions:
 - property labelBackgroundVisibleᅟ: bool¶
 - This property holds Whether the label is drawn with a color background or with a fully transparent background.. - The - labelBackgroundColorvalue (including alpha) is used for drawing the background.- Labels with a background are drawn to equal sizes per axis based on the longest label, and the text is centered in them. Labels without a background are drawn as is and are left or right aligned based on their position in the graph. The default value is - true.- Access functions:
 - property labelBorderVisibleᅟ: bool¶
 - This property holds Whether label borders are drawn for labels that have a background.. - Has no effect if - labelBackgroundVisibleis- false. The default value is- true.- Access functions:
 - This property holds The font to be used for labels.. - Access functions:
 - This property holds The color of the font used for labels.. - If an axis has specified - labelTextColorexplicitly, this has no effect.- The default value depends on - colorScheme.- Access functions:
 - property labelsVisibleᅟ: bool¶
 - This property holds Whether labels are drawn at all.. - If this is - false, all other label properties have no effect. The default value is- true.- Access functions:
 - This property holds The highlight color for selected objects.. - Used if - selectionModehas the- QtGraphs3D::SelectionFlag::Rowor- QtGraphs3D::SelectionFlag::Columnflag set. The default value depends on- colorScheme.- Access functions:
 - This property holds The color of the graph plot area background. The default value depends on - colorScheme..- Access functions:
 - property plotAreaBackgroundVisibleᅟ: bool¶
 - This property holds Whether the plot area background is visible.. - The background is drawn by using the value of - plotAreaBackgroundColor. The default value is- true.- Access functions:
 - property seriesColorsᅟ: list of QColor¶
 - This property holds The list of base colors to be used for all the objects in the graph, series by series.. - If there are more series than colors, the color list wraps and starts again with the first color in the list. - Has no immediate effect if - colorStyleis not Uniform.- This value can be overridden by setting the - baseColorexplicitly in the series.- Access functions:
 - This property holds The highlight color for a selected object.. - Used if - selectionModehas the- QtGraphs3D::SelectionFlag::Itemflag set. The default value depends on- colorScheme.- Access functions:
 - property themeᅟ: QGraphsTheme.Theme¶
 - The type of the theme. If no type is set, the type is - QtGreen. Changing the theme type after the item has been constructed will change all other properties of the theme to what the predefined theme specifies. Changing the theme type of the active theme of the graph will also reset all attached series to use the new theme.- Access functions:
- Signal - themeChanged()
 
 - axisX()¶
- Return type:
 - See also 
 - Getter of property - axisXᅟ.- axisXChanged()¶
 - Notification signal of property - axisXᅟ.- axisXLabelFont()¶
- Return type:
 - See also 
 - Getter of property - axisXLabelFontᅟ.- axisXLabelFontChanged()¶
 - Notification signal of property - axisXLabelFontᅟ.- axisY()¶
- Return type:
 - See also 
 - Getter of property - axisYᅟ.- axisYChanged()¶
 - Notification signal of property - axisYᅟ.- axisYLabelFont()¶
- Return type:
 - See also 
 - Getter of property - axisYLabelFontᅟ.- axisYLabelFontChanged()¶
 - Notification signal of property - axisYLabelFontᅟ.- axisZ()¶
- Return type:
 - See also 
 - Getter of property - axisZᅟ.- axisZChanged()¶
 - Notification signal of property - axisZᅟ.- axisZLabelFont()¶
- Return type:
 - See also 
 - Getter of property - axisZLabelFontᅟ.- axisZLabelFontChanged()¶
 - Notification signal of property - axisZLabelFontᅟ.- backgroundColor()¶
- Return type:
 - See also 
 - Getter of property - backgroundColorᅟ.- backgroundColorChanged()¶
 - Notification signal of property - backgroundColorᅟ.- backgroundVisibleChanged()¶
 - Notification signal of property - backgroundVisibleᅟ.- Getter of property - borderColorsᅟ.- borderColorsChanged()¶
 - Notification signal of property - borderColorsᅟ.- borderWidth()¶
- Return type:
- float 
 - See also 
 - Getter of property - borderWidthᅟ.- borderWidthChanged()¶
 - Notification signal of property - borderWidthᅟ.- colorScheme()¶
- Return type:
 - See also 
 - Getter of property - colorSchemeᅟ.- colorSchemeChanged()¶
 - Notification signal of property - colorSchemeᅟ.- colorStyle()¶
- Return type:
 - See also 
 - Getter of property - colorStyleᅟ.- colorStyleChanged(type)¶
- Parameters:
- type – - ColorStyle
 
 - Notification signal of property - colorStyleᅟ.- dirtyBits()¶
- Return type:
 
 - grid()¶
- Return type:
 - See also 
 - Getter of property - gridᅟ.- gridChanged()¶
 - Notification signal of property - gridᅟ.- gridVisibleChanged()¶
 - Notification signal of property - gridVisibleᅟ.- handleBaseColorUpdate()¶
 - handleBaseGradientUpdate()¶
 - isBackgroundVisible()¶
- Return type:
- bool 
 
 - Getter of property - backgroundVisibleᅟ.- isGridVisible()¶
- Return type:
- bool 
 
 - Getter of property - gridVisibleᅟ.- isLabelBackgroundVisible()¶
- Return type:
- bool 
 
 - Getter of property - labelBackgroundVisibleᅟ.- isLabelBorderVisible()¶
- Return type:
- bool 
 
 - Getter of property - labelBorderVisibleᅟ.- isPlotAreaBackgroundVisible()¶
- Return type:
- bool 
 
 - Getter of property - plotAreaBackgroundVisibleᅟ.- labelBackgroundColor()¶
- Return type:
 - See also 
 - Getter of property - labelBackgroundColorᅟ.- labelBackgroundColorChanged()¶
 - Notification signal of property - labelBackgroundColorᅟ.- labelBackgroundVisibleChanged()¶
 - Notification signal of property - labelBackgroundVisibleᅟ.- labelBorderVisibleChanged()¶
 - Notification signal of property - labelBorderVisibleᅟ.- labelFont()¶
- Return type:
 - See also 
 - Getter of property - labelFontᅟ.- labelFontChanged()¶
 - Notification signal of property - labelFontᅟ.- labelTextColor()¶
- Return type:
 - See also 
 - Getter of property - labelTextColorᅟ.- labelTextColorChanged()¶
 - Notification signal of property - labelTextColorᅟ.- labelsVisible()¶
- Return type:
- bool 
 - See also 
 - Getter of property - labelsVisibleᅟ.- labelsVisibleChanged()¶
 - Notification signal of property - labelsVisibleᅟ.- multiHighlightColor()¶
- Return type:
 - See also 
 - Getter of property - multiHighlightColorᅟ.- Notification signal of property - multiHighlightColorᅟ.- multiHighlightGradient()¶
- Return type:
 
 - multiHighlightGradientChanged(gradient)¶
- Parameters:
- gradient – - QLinearGradient
 
 - multiHighlightGradientQMLChanged()¶
 - plotAreaBackgroundColor()¶
- Return type:
 - See also 
 - Getter of property - plotAreaBackgroundColorᅟ.- plotAreaBackgroundColorChanged()¶
 - Notification signal of property - plotAreaBackgroundColorᅟ.- plotAreaBackgroundVisibleChanged()¶
 - Notification signal of property - plotAreaBackgroundVisibleᅟ.- resetColorTheme()¶
 - resetDirtyBits()¶
 - resetThemeDirty()¶
 - Getter of property - seriesColorsᅟ.- seriesColorsChanged(list)¶
- Parameters:
- list – .list of QColor 
 
 - Notification signal of property - seriesColorsᅟ.- seriesGradients()¶
- Return type:
- .list of QLinearGradient 
 
 - Returns the list of series gradients used by theme. - See also - seriesGradientsChanged(list)¶
- Parameters:
- list – .list of QLinearGradient 
 
 - setAxisX(newAxisX)¶
- Parameters:
- newAxisX – - QGraphsLine
 - See also 
 - Setter of property - axisXᅟ.- Setter of property - axisXLabelFontᅟ.- setAxisY(newAxisY)¶
- Parameters:
- newAxisY – - QGraphsLine
 - See also 
 - Setter of property - axisYᅟ.- Setter of property - axisYLabelFontᅟ.- setAxisZ(newAxisZ)¶
- Parameters:
- newAxisZ – - QGraphsLine
 - See also 
 - Setter of property - axisZᅟ.- Setter of property - axisZLabelFontᅟ.- Setter of property - backgroundColorᅟ.- setBackgroundVisible(newBackgroundVisible)¶
- Parameters:
- newBackgroundVisible – bool 
 - See also 
 - Setter of property - backgroundVisibleᅟ.- setBorderColors(newBorderColors)¶
- Parameters:
- newBorderColors – .list of QColor 
 - See also 
 - Setter of property - borderColorsᅟ.- setBorderWidth(newBorderWidth)¶
- Parameters:
- newBorderWidth – float 
 - See also 
 - Setter of property - borderWidthᅟ.- setColorScheme(newColorScheme)¶
- Parameters:
- newColorScheme – - ColorScheme
 - See also 
 - Setter of property - colorSchemeᅟ.- setColorStyle(newColorStyle)¶
- Parameters:
- newColorStyle – - ColorStyle
 - See also 
 - Setter of property - colorStyleᅟ.- setGrid(newGrid)¶
- Parameters:
- newGrid – - QGraphsLine
 - See also 
 - Setter of property - gridᅟ.- setGridVisible(newGridVisibility)¶
- Parameters:
- newGridVisibility – bool 
 - See also 
 - Setter of property - gridVisibleᅟ.- setLabelBackgroundColor(newLabelBackgroundColor)¶
- Parameters:
- newLabelBackgroundColor – - QColor
 - See also 
 - Setter of property - labelBackgroundColorᅟ.- setLabelBackgroundVisible(newLabelBackgroundVisibility)¶
- Parameters:
- newLabelBackgroundVisibility – bool 
 - See also 
 - Setter of property - labelBackgroundVisibleᅟ.- setLabelBorderVisible(newLabelBorderVisibility)¶
- Parameters:
- newLabelBorderVisibility – bool 
 - See also 
 - Setter of property - labelBorderVisibleᅟ.- Setter of property - labelFontᅟ.- Setter of property - labelTextColorᅟ.- setLabelsVisible(newLabelsVisibility)¶
- Parameters:
- newLabelsVisibility – bool 
 - See also 
 - Setter of property - labelsVisibleᅟ.- setMultiHighlightColor(newMultiHighlightColor)¶
- Parameters:
- newMultiHighlightColor – - QColor
 - See also 
 - Setter of property - multiHighlightColorᅟ.- setMultiHighlightGradient(gradient)¶
- Parameters:
- gradient – - QLinearGradient
 
 - Setter of property - plotAreaBackgroundColorᅟ.- setPlotAreaBackgroundVisible(newBackgroundVisibility)¶
- Parameters:
- newBackgroundVisibility – bool 
 - See also 
 - Setter of property - plotAreaBackgroundVisibleᅟ.- setSeriesColors(newSeriesColors)¶
- Parameters:
- newSeriesColors – .list of QColor 
 - See also 
 - Setter of property - seriesColorsᅟ.- setSeriesGradients(newSeriesGradients)¶
- Parameters:
- newSeriesGradients – .list of QLinearGradient 
 
 - Sets - newSeriesGradientsas the series gradients for the theme.- See also - setSingleHighlightColor(newSingleHighlightColor)¶
- Parameters:
- newSingleHighlightColor – - QColor
 - See also 
 - Setter of property - singleHighlightColorᅟ.- setSingleHighlightGradient(gradient)¶
- Parameters:
- gradient – - QLinearGradient
 
 - setTheme(newTheme[, force=QGraphsTheme.ForceTheme.No])¶
- Parameters:
- newTheme – - Theme
- force – - ForceTheme
 
 - See also 
 - singleHighlightColor()¶
- Return type:
 - See also 
 - Getter of property - singleHighlightColorᅟ.- Notification signal of property - singleHighlightColorᅟ.- singleHighlightGradient()¶
- Return type:
 
 - singleHighlightGradientChanged(gradient)¶
- Parameters:
- gradient – - QLinearGradient
 
 - singleHighlightGradientQMLChanged()¶
 - theme()¶
- Return type:
 - See also 
 - Getter of property - themeᅟ.- Notification signal of property - themeᅟ.- themeDirty()¶
- Return type:
- bool 
 
 - update()¶