Q3DTheme

Q3DTheme class provides a visual style for graphs. More

Inheritance diagram of PySide6.QtDataVisualization.Q3DTheme

Synopsis

Functions

Detailed Description

Specifies visual properties that affect the whole graph. There are several built-in themes that can be used as is or modified freely.

The following properties can be overridden by using QAbstract3DSeries properties to set them explicitly in the series: baseColors , baseGradients , and colorStyle .

Themes can be created from scratch using the ThemeUserDefined enum value. Creating a theme using the default constructor produces a new user-defined theme.

Default Theme

The following table lists the properties controlled by themes and the default values for ThemeUserDefined .

Property

Default Value

ambientLightStrength

0.25

backgroundColor

black

backgroundEnabled

true

baseColors

black

baseGradients

QLinearGradient . Essentially fully black.

colorStyle

ColorStyleUniform

font

QFont

gridEnabled

true

gridLineColor

white

highlightLightStrength

7.5

labelBackgroundColor

gray

labelBackgroundEnabled

true

labelBorderEnabled

true

labelTextColor

white

lightColor

white

lightStrength

5.0

multiHighlightColor

blue

multiHighlightGradient

QLinearGradient . Essentially fully black.

singleHighlightColor

red

singleHighlightGradient

QLinearGradient . Essentially fully black.

windowColor

black

Usage Examples

Creating a built-in theme without any modifications:

Q3DTheme *theme = new Q3DTheme(Q3DTheme::ThemeQt);

Creating a built-in theme and modifying some properties:

Q3DTheme *theme = new Q3DTheme(Q3DTheme::ThemeQt);
theme->setBackgroundEnabled(false);
theme->setLabelBackgroundEnabled(false);

Creating a user-defined theme:

Q3DTheme *theme = new Q3DTheme();
theme->setAmbientLightStrength(0.3f);
theme->setBackgroundColor(QColor(QRgb(0x99ca53)));
theme->setBackgroundEnabled(true);
theme->setBaseColor(QColor(QRgb(0x209fdf)));
theme->setColorStyle(Q3DTheme::ColorStyleUniform);
theme->setFont(QFont(QStringLiteral("Impact"), 35));
theme->setGridEnabled(true);
theme->setGridLineColor(QColor(QRgb(0x99ca53)));
theme->setHighlightLightStrength(7.0f);
theme->setLabelBackgroundColor(QColor(0xf6, 0xa6, 0x25, 0xa0));
theme->setLabelBackgroundEnabled(true);
theme->setLabelBorderEnabled(true);
theme->setLabelTextColor(QColor(QRgb(0x404044)));
theme->setLightColor(Qt::white);
theme->setLightStrength(6.0f);
theme->setMultiHighlightColor(QColor(QRgb(0x6d5fd5)));
theme->setSingleHighlightColor(QColor(QRgb(0xf6a625)));
theme->setWindowColor(QColor(QRgb(0xffffff)));

Creating a built-in theme and modifying some properties after it has been set:

Q3DBars *graph = new Q3DBars();
graph->activeTheme()->setType(Q3DTheme::ThemePrimaryColors);
graph->activeTheme()->setBaseColor(Qt::red);
graph->activeTheme()->setSingleHighlightColor(Qt::yellow);
class PySide6.QtDataVisualization.Q3DTheme(themeType[, parent=None])

PySide6.QtDataVisualization.Q3DTheme([parent=None])

Parameters

Constructs a new theme with themeType, which can be one of the built-in themes from Theme . An optional parent parameter can be given and is then passed to QObject constructor.

Constructs a new theme of type ThemeUserDefined . An optional parent parameter can be given and is then passed to QObject constructor.

PySide6.QtDataVisualization.Q3DTheme.ColorStyle

Color styles.

Constant

Description

Q3DTheme.ColorStyleUniform

Objects are rendered in a single color. The color used is specified in baseColors , singleHighlightColor and multiHighlightColor properties.

Q3DTheme.ColorStyleObjectGradient

Objects are colored using a full gradient for each object regardless of object height. The gradient used is specified in baseGradients , singleHighlightGradient and multiHighlightGradient properties.

Q3DTheme.ColorStyleRangeGradient

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 baseGradients , singleHighlightGradient and multiHighlightGradient properties.

PySide6.QtDataVisualization.Q3DTheme.Theme

Built-in themes.

Constant

Description

Q3DTheme.ThemeQt

A light theme with green as the base color.

Q3DTheme.ThemePrimaryColors

A light theme with yellow as the base color.

Q3DTheme.ThemeDigia

A light theme with gray as the base color.

Q3DTheme.ThemeStoneMoss

A medium dark theme with yellow as the base color.

Q3DTheme.ThemeArmyBlue

A medium light theme with blue as the base color.

Q3DTheme.ThemeRetro

A medium light theme with brown as the base color.

Q3DTheme.ThemeEbony

A dark theme with white as the base color.

Q3DTheme.ThemeIsabelle

A dark theme with yellow as the base color.

Q3DTheme.ThemeUserDefined

A user-defined theme. For more information, see Default Theme .

PySide6.QtDataVisualization.Q3DTheme.ambientLightStrength()
Return type

float

PySide6.QtDataVisualization.Q3DTheme.ambientLightStrengthChanged(strength)
Parameters

strength – float

PySide6.QtDataVisualization.Q3DTheme.backgroundColor()
Return type

PySide6.QtGui.QColor

PySide6.QtDataVisualization.Q3DTheme.backgroundColorChanged(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtDataVisualization.Q3DTheme.backgroundEnabledChanged(enabled)
Parameters

enabled – bool

PySide6.QtDataVisualization.Q3DTheme.baseColors()
Return type

See also

setBaseColors()

PySide6.QtDataVisualization.Q3DTheme.baseColorsChanged(colors)
Parameters

colors

PySide6.QtDataVisualization.Q3DTheme.baseGradients()
Return type

PySide6.QtDataVisualization.Q3DTheme.baseGradientsChanged(gradients)
Parameters

gradients

PySide6.QtDataVisualization.Q3DTheme.colorStyle()
Return type

ColorStyle

See also

setColorStyle()

PySide6.QtDataVisualization.Q3DTheme.colorStyleChanged(style)
Parameters

styleColorStyle

PySide6.QtDataVisualization.Q3DTheme.font()
Return type

PySide6.QtGui.QFont

See also

setFont()

PySide6.QtDataVisualization.Q3DTheme.fontChanged(font)
Parameters

fontPySide6.QtGui.QFont

PySide6.QtDataVisualization.Q3DTheme.gridEnabledChanged(enabled)
Parameters

enabled – bool

PySide6.QtDataVisualization.Q3DTheme.gridLineColor()
Return type

PySide6.QtGui.QColor

PySide6.QtDataVisualization.Q3DTheme.gridLineColorChanged(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtDataVisualization.Q3DTheme.highlightLightStrength()
Return type

float

PySide6.QtDataVisualization.Q3DTheme.highlightLightStrengthChanged(strength)
Parameters

strength – float

PySide6.QtDataVisualization.Q3DTheme.isBackgroundEnabled()
Return type

bool

PySide6.QtDataVisualization.Q3DTheme.isGridEnabled()
Return type

bool

PySide6.QtDataVisualization.Q3DTheme.isLabelBackgroundEnabled()
Return type

bool

PySide6.QtDataVisualization.Q3DTheme.isLabelBorderEnabled()
Return type

bool

PySide6.QtDataVisualization.Q3DTheme.labelBackgroundColor()
Return type

PySide6.QtGui.QColor

PySide6.QtDataVisualization.Q3DTheme.labelBackgroundColorChanged(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtDataVisualization.Q3DTheme.labelBackgroundEnabledChanged(enabled)
Parameters

enabled – bool

PySide6.QtDataVisualization.Q3DTheme.labelBorderEnabledChanged(enabled)
Parameters

enabled – bool

PySide6.QtDataVisualization.Q3DTheme.labelTextColor()
Return type

PySide6.QtGui.QColor

PySide6.QtDataVisualization.Q3DTheme.labelTextColorChanged(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtDataVisualization.Q3DTheme.lightColor()
Return type

PySide6.QtGui.QColor

See also

setLightColor()

PySide6.QtDataVisualization.Q3DTheme.lightColorChanged(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtDataVisualization.Q3DTheme.lightStrength()
Return type

float

PySide6.QtDataVisualization.Q3DTheme.lightStrengthChanged(strength)
Parameters

strength – float

PySide6.QtDataVisualization.Q3DTheme.multiHighlightColor()
Return type

PySide6.QtGui.QColor

PySide6.QtDataVisualization.Q3DTheme.multiHighlightColorChanged(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtDataVisualization.Q3DTheme.multiHighlightGradient()
Return type

PySide6.QtGui.QLinearGradient

PySide6.QtDataVisualization.Q3DTheme.multiHighlightGradientChanged(gradient)
Parameters

gradientPySide6.QtGui.QLinearGradient

PySide6.QtDataVisualization.Q3DTheme.setAmbientLightStrength(strength)
Parameters

strength – float

PySide6.QtDataVisualization.Q3DTheme.setBackgroundColor(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtDataVisualization.Q3DTheme.setBackgroundEnabled(enabled)
Parameters

enabled – bool

PySide6.QtDataVisualization.Q3DTheme.setBaseColors(colors)
Parameters

colors

See also

baseColors()

PySide6.QtDataVisualization.Q3DTheme.setBaseGradients(gradients)
Parameters

gradients

See also

baseGradients()

PySide6.QtDataVisualization.Q3DTheme.setColorStyle(style)
Parameters

styleColorStyle

See also

colorStyle()

PySide6.QtDataVisualization.Q3DTheme.setFont(font)
Parameters

fontPySide6.QtGui.QFont

See also

font()

PySide6.QtDataVisualization.Q3DTheme.setGridEnabled(enabled)
Parameters

enabled – bool

See also

isGridEnabled()

PySide6.QtDataVisualization.Q3DTheme.setGridLineColor(color)
Parameters

colorPySide6.QtGui.QColor

See also

gridLineColor()

PySide6.QtDataVisualization.Q3DTheme.setHighlightLightStrength(strength)
Parameters

strength – float

PySide6.QtDataVisualization.Q3DTheme.setLabelBackgroundColor(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtDataVisualization.Q3DTheme.setLabelBackgroundEnabled(enabled)
Parameters

enabled – bool

PySide6.QtDataVisualization.Q3DTheme.setLabelBorderEnabled(enabled)
Parameters

enabled – bool

PySide6.QtDataVisualization.Q3DTheme.setLabelTextColor(color)
Parameters

colorPySide6.QtGui.QColor

See also

labelTextColor()

PySide6.QtDataVisualization.Q3DTheme.setLightColor(color)
Parameters

colorPySide6.QtGui.QColor

See also

lightColor()

PySide6.QtDataVisualization.Q3DTheme.setLightStrength(strength)
Parameters

strength – float

See also

lightStrength()

PySide6.QtDataVisualization.Q3DTheme.setMultiHighlightColor(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtDataVisualization.Q3DTheme.setMultiHighlightGradient(gradient)
Parameters

gradientPySide6.QtGui.QLinearGradient

PySide6.QtDataVisualization.Q3DTheme.setSingleHighlightColor(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtDataVisualization.Q3DTheme.setSingleHighlightGradient(gradient)
Parameters

gradientPySide6.QtGui.QLinearGradient

PySide6.QtDataVisualization.Q3DTheme.setType(themeType)
Parameters

themeTypeTheme

See also

type()

PySide6.QtDataVisualization.Q3DTheme.setWindowColor(color)
Parameters

colorPySide6.QtGui.QColor

See also

windowColor()

PySide6.QtDataVisualization.Q3DTheme.singleHighlightColor()
Return type

PySide6.QtGui.QColor

PySide6.QtDataVisualization.Q3DTheme.singleHighlightColorChanged(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtDataVisualization.Q3DTheme.singleHighlightGradient()
Return type

PySide6.QtGui.QLinearGradient

PySide6.QtDataVisualization.Q3DTheme.singleHighlightGradientChanged(gradient)
Parameters

gradientPySide6.QtGui.QLinearGradient

PySide6.QtDataVisualization.Q3DTheme.type()
Return type

Theme

See also

setType()

PySide6.QtDataVisualization.Q3DTheme.typeChanged(themeType)
Parameters

themeTypeTheme

PySide6.QtDataVisualization.Q3DTheme.windowColor()
Return type

PySide6.QtGui.QColor

See also

setWindowColor()

PySide6.QtDataVisualization.Q3DTheme.windowColorChanged(color)
Parameters

colorPySide6.QtGui.QColor