A visual style for graphs. 更多...
import 语句: | import QtDataVisualization 1.2 |
Since: | QtDataVisualization 1.0 |
实例化: | Q3DTheme |
This type is used to specify visual properties that affect the whole graph. There are several built-in themes that can be used as is or modified freely.
可以覆写以下特性通过使用 Abstract3DSeries 特性以按系列明确设置它们: baseColors , baseGradients ,和 colorStyle .
Themes can be created from scratch by using the Theme3D.ThemeUserDefined 枚举值。
The following table lists the properties controlled by themes and the default values for Theme3D.ThemeUserDefined .
特性 | 默认值 |
---|---|
ambientLightStrength | 0.25 |
backgroundColor | "black". For more information, see color . |
backgroundEnabled |
true
|
baseColors | "black" |
baseGradients | QLinearGradient 。本质上全黑。 |
colorStyle | ColorStyleUniform |
font | font |
gridEnabled |
true
|
gridLineColor | "white" |
highlightLightStrength | 7.5 |
labelBackgroundColor | "gray" |
labelBackgroundEnabled |
true
|
labelBorderEnabled |
true
|
labelTextColor | "white" |
lightColor | "white" |
lightStrength | 5.0 |
multiHighlightColor | "blue" |
multiHighlightGradient | QLinearGradient 。本质上全黑。 |
singleHighlightColor | "red" |
singleHighlightGradient | QLinearGradient 。本质上全黑。 |
windowColor | "black" |
Using a built-in theme without any modifications:
Scatter3D { ... theme: Theme3D { type: Theme3D.ThemeRetro } ... }
Using a built-in theme and modifying some properties:
Bars3D { ... theme: Theme3D { type: Theme3D.ThemeRetro labelBorderEnabled: true font.pointSize: 35 labelBackgroundEnabled: false } ... }
Using a user-defined theme:
Surface3D { ... theme: Theme3D { ambientLightStrength: 0.5 backgroundColor: "red" backgroundEnabled: true baseColor: "blue" colorStyle: Theme3D.ColorStyleUniform font.family: "Lucida Handwriting" font.pointSize: 35 gridEnabled: false gridLineColor: "black" highlightLightStrength: 0.5 labelBackgroundColor: "black" labelBackgroundEnabled: true labelBorderEnabled: false labelTextColor: "white" lightColor: "yellow" lightStrength: 0.4 multiHighlightColor: "green" singleHighlightColor: "darkRed" windowColor: "white" } ... }
For Theme3D enums, see Q3DTheme::ColorStyle and Q3DTheme::Theme .
The ambient light strength for the whole graph. This value determines how evenly and brightly the colors are shown throughout the graph regardless of the light position. The value must be between
0.0
and
1.0
.
The color of the graph background.
Defines whether the background is drawn by using the value of backgroundColor .
baseColors : list < ThemeColor > |
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, color list wraps and starts again with the first color in the list. Has no immediate effect if
colorStyle
不是
Theme3D.ColorStyleUniform
.
This can be overridden by setting Abstract3DSeries.baseColor explicitly in the series.
baseGradients : list < ColorGradient > |
The list of base gradients to be used for all the objects in the graph, series by series. If there are more series than gradients, the gradient list wraps and starts again with the first gradient in the list.
Has no immediate effect if colorStyle is Theme3D.ColorStyleUniform .
This value can be overridden by setting Abstract3DSeries.baseGradient explicitly in the series.
colorStyle : Theme3D . ColorStyle |
The style of the graph colors. One of Q3DTheme::ColorStyle 枚举值。
This value can be overridden by setting Abstract3DSeries.colorStyle explicitly in the series.
另请参阅 Q3DTheme::ColorStyle .
font : font |
Sets the font to be used for labels.
Defines whether the grid lines are drawn. This value affects all grid lines.
The color of the grid lines.
The specular light strength for selected objects. The value must be between
0.0
and
10.0
.
The color of the label backgrounds. Has no effect if
labelBackgroundEnabled
is
false
.
Defines whether the label is drawn with a background that uses labelBackgroundColor (including alpha), or with a fully transparent 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.
Defines whether label borders are drawn for labels that have a background. Has no effect if
labelBackgroundEnabled
is
false
.
The color of the font used for labels.
The color of the ambient and specular light defined in Scene3D .
The specular light strength for the whole graph. The value must be between
0.0
and
10.0
.
This value affects the light specified in Scene3D .
The highlight color for selected objects. Used if
selectionMode
拥有
AbstractGraph3D.SelectionRow
or
AbstractGraph3D.SelectionColumn
设置标志。
multiHighlightGradient : ColorGradient |
The highlight gradient for selected objects. Used if
selectionMode
拥有
AbstractGraph3D.SelectionRow
or
AbstractGraph3D.SelectionColumn
设置标志。
The highlight color for a selected object. Used if
selectionMode
拥有
AbstractGraph3D.SelectionItem
设置标志。
singleHighlightGradient : ColorGradient |
The highlight gradient for a selected object. Used if
selectionMode
拥有
AbstractGraph3D.SelectionItem
设置标志。
type : Theme3D . Theme |
The type of the theme. If no type is set, the type is Theme3D.ThemeUserDefined . 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.
The color of the application window the graph is drawn into.