Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
None
Description
2D Graphs used to have SeriesTheme which in common theming got replaced with GraphsTheme. Currently this code has exactly the same output with and without GraphsTheme.
GraphsView { BarSeries { theme: GraphsTheme { backgroundEnabled : true gridMainWidth: 5 axisXSubColor: "red" axisYMainWidth: 8 labelBorderEnabled: true } } }
Few options what we could do:
1) Document that when GraphsTheme is used in series, only seriesColors, borderColors and borderWidth are used. Is this anyway confusing for users to have plenty of unused properties?
2) Remove theme property from QAbstractSeries and just use GraphsView theme instead. How will user set series theming in multiseries case, so e.g. red line series and blue bar series? QBarSet contains color & borderColor properties which can be used for each set, but no common way for the whole series.
3) Combined with 2), add separate "QList<QColor> seriesColors", "QList<QColor> borderColors" etc. properties into QAbstractSeries which can be used to override the ones in GraphsView theme. How many properties would be needed?
4) Bring back SeriesTheme into common GraphsTheme. Series related theme properties would be moved into SeriesTheme and QAbstractSeries would contain SeriesTheme property to override these. Something like:
GraphsView { theme: GraphsTheme { colorScheme: Qt.Dark axisXLabelFont.pixelSize: 20 axisYLabelFont.pixelSize: 16 labelFont.pixelSize: 20 seriesTheme: SeriesTheme { theme: SeriesTheme.Theme.QtGreen } } AreaSeries { // No theme set, so using GraphsView series theme } LineSeries { theme: SeriesTheme { theme: SeriesTheme.Theme.OrangeSeries } } BarSeries { theme: SeriesTheme { seriesColors: ["#444444", "#555555", "#666666", "#777777"] borderColors: ["#888888", "#999999", "#aaaaaa", "#bbbbbb"] } } }
5) Something else?