@@ -522,7 +522,11 QColor QBarSet::labelColor() | |||
|
522 | 522 | */ |
|
523 | 523 | void QBarSet::setLabelColor(QColor color) |
|
524 | 524 | { |
|
525 | QBrush defaultBrush; | |
|
525 | 526 | QBrush b = labelBrush(); |
|
527 | if (b == defaultBrush) | |
|
528 | b.setStyle(Qt::SolidPattern); | |
|
529 | ||
|
526 | 530 | if (b.color() != color) { |
|
527 | 531 | b.setColor(color); |
|
528 | 532 | setLabelBrush(b); |
@@ -82,22 +82,22 ChartTheme::ChartTheme(QChart::ChartTheme id) : | |||
|
82 | 82 | ChartTheme* ChartTheme::createTheme(QChart::ChartTheme theme) |
|
83 | 83 | { |
|
84 | 84 | switch(theme) { |
|
85 |
|
|
|
86 |
|
|
|
87 |
|
|
|
88 |
|
|
|
89 |
|
|
|
90 |
|
|
|
91 |
|
|
|
92 |
|
|
|
93 |
|
|
|
94 |
|
|
|
95 |
|
|
|
96 |
|
|
|
97 |
|
|
|
98 |
|
|
|
99 |
|
|
|
100 |
|
|
|
85 | case QChart::ChartThemeLight: | |
|
86 | return new ChartThemeLight(); | |
|
87 | case QChart::ChartThemeBlueCerulean: | |
|
88 | return new ChartThemeBlueCerulean(); | |
|
89 | case QChart::ChartThemeDark: | |
|
90 | return new ChartThemeDark(); | |
|
91 | case QChart::ChartThemeBrownSand: | |
|
92 | return new ChartThemeBrownSand(); | |
|
93 | case QChart::ChartThemeBlueNcs: | |
|
94 | return new ChartThemeBlueNcs(); | |
|
95 | case QChart::ChartThemeHighContrast: | |
|
96 | return new ChartThemeHighContrast(); | |
|
97 | case QChart::ChartThemeBlueIcy: | |
|
98 | return new ChartThemeBlueIcy(); | |
|
99 | default: | |
|
100 | return new ChartThemeSystem(); | |
|
101 | 101 | } |
|
102 | 102 | } |
|
103 | 103 | |
@@ -143,8 +143,8 void ChartTheme::decorate(QAreaSeries *series, int index) | |||
|
143 | 143 | } |
|
144 | 144 | |
|
145 | 145 | if (brush == series->brush() || m_force) { |
|
146 | QBrush brush(m_seriesColors.at(index % m_seriesColors.size())); | |
|
147 | series->setBrush(brush); | |
|
146 | QBrush brush(m_seriesColors.at(index % m_seriesColors.size())); | |
|
147 | series->setBrush(brush); | |
|
148 | 148 | } |
|
149 | 149 | } |
|
150 | 150 | |
@@ -189,10 +189,12 void ChartTheme::decorate(QAbstractBarSeries *series, int index) | |||
|
189 | 189 | |
|
190 | 190 | // Pick label color from the opposite end of the gradient. |
|
191 | 191 | // 0.3 as a boundary seems to work well. |
|
192 | if (takeAtPos < 0.3) | |
|
193 | sets.at(i)->setLabelBrush(colorAt(m_seriesGradients.at(index % m_seriesGradients.size()), 1)); | |
|
194 | else | |
|
195 | sets.at(i)->setLabelBrush(colorAt(m_seriesGradients.at(index % m_seriesGradients.size()), 0)); | |
|
192 | if (brush == sets.at(i)->labelBrush() || m_force) { | |
|
193 | if (takeAtPos < 0.3) | |
|
194 | sets.at(i)->setLabelBrush(colorAt(m_seriesGradients.at(index % m_seriesGradients.size()), 1)); | |
|
195 | else | |
|
196 | sets.at(i)->setLabelBrush(colorAt(m_seriesGradients.at(index % m_seriesGradients.size()), 0)); | |
|
197 | } | |
|
196 | 198 | |
|
197 | 199 | if (pen == sets.at(i)->pen() || m_force) { |
|
198 | 200 | QColor c = colorAt(m_seriesGradients.at(index % m_seriesGradients.size()), 0.0); |
@@ -274,23 +276,23 void ChartTheme::decorate(QAbstractAxis *axis) | |||
|
274 | 276 | } |
|
275 | 277 | |
|
276 | 278 | |
|
277 | if (axis->shadesVisible() || m_force) { | |
|
279 | if (axis->shadesVisible() || m_force) { | |
|
278 | 280 | |
|
279 | if(brush == axis->shadesBrush() || m_force){ | |
|
280 | axis->setShadesBrush(m_backgroundShadesBrush); | |
|
281 | } | |
|
281 | if(brush == axis->shadesBrush() || m_force){ | |
|
282 | axis->setShadesBrush(m_backgroundShadesBrush); | |
|
283 | } | |
|
282 | 284 | |
|
283 | if(pen == axis->shadesPen() || m_force){ | |
|
284 | axis->setShadesPen(m_backgroundShadesPen); | |
|
285 | } | |
|
285 | if(pen == axis->shadesPen() || m_force){ | |
|
286 | axis->setShadesPen(m_backgroundShadesPen); | |
|
287 | } | |
|
286 | 288 | |
|
287 | if( m_force && (m_backgroundShades == BackgroundShadesBoth | |
|
288 | || (m_backgroundShades == BackgroundShadesVertical && axisX) | |
|
289 | || (m_backgroundShades == BackgroundShadesHorizontal && !axisX))){ | |
|
290 | axis->setShadesVisible(true); | |
|
289 | if( m_force && (m_backgroundShades == BackgroundShadesBoth | |
|
290 | || (m_backgroundShades == BackgroundShadesVertical && axisX) | |
|
291 | || (m_backgroundShades == BackgroundShadesHorizontal && !axisX))){ | |
|
292 | axis->setShadesVisible(true); | |
|
291 | 293 | |
|
292 | } | |
|
293 | } | |
|
294 | } | |
|
295 | } | |
|
294 | 296 | |
|
295 | 297 | if(pen == axis->axisPen() || m_force){ |
|
296 | 298 | axis->setAxisPen(m_axisLinePen); |
General Comments 0
You need to be logged in to leave comments.
Login now