##// END OF EJS Templates
Enabled color themes again
Tero Ahola -
r91:a70d6fec8ca6
parent child
Show More
@@ -24,7 +24,7 QChart::QChart(QGraphicsObject* parent) : QGraphicsObject(parent),
24 24 m_marginSize(0)
25 25 {
26 26 // TODO: the default theme?
27 //setTheme(QChart::ChartThemeVanilla);
27 setTheme(QChart::ChartThemeDefault);
28 28
29 29 PlotDomain domain;
30 30 m_plotDomainList<<domain;
@@ -246,7 +246,10 void QChart::setTheme(QChart::ChartThemeId theme)
246 246 switch (theme) {
247 247 case QChart::ChartThemeDefault:
248 248 // TODO: define the default theme based on the OS
249 // For now we just fallthrough to "vanilla"
249 m_themeColors.append(QColor(QRgb(0xff000000)));
250 m_themeColors.append(QColor(QRgb(0xff707070)));
251 setBackground(QColor(QRgb(0xffffffff)), QColor(QRgb(0xffafafaf)), VerticalGradientOrientation);
252 break;
250 253 case QChart::ChartThemeVanilla:
251 254 m_themeColors.append(QColor(217, 197, 116));
252 255 m_themeColors.append(QColor(214, 168, 150));
@@ -254,8 +257,7 void QChart::setTheme(QChart::ChartThemeId theme)
254 257 m_themeColors.append(QColor(210, 210, 52));
255 258 m_themeColors.append(QColor(136, 114, 58));
256 259
257 m_backgroundGradient.setColorAt(0.0, QColor(QRgb(0xff9d844d)));
258 m_backgroundGradient.setColorAt(1.0, QColor(QRgb(0xffafafaf)));
260 setBackground(QColor(QRgb(0xff9d844d)), QColor(QRgb(0xffafafaf)), VerticalGradientOrientation);
259 261 break;
260 262 case QChart::ChartThemeIcy:
261 263 m_themeColors.append(QColor(0, 3, 165));
@@ -265,8 +267,7 void QChart::setTheme(QChart::ChartThemeId theme)
265 267 m_themeColors.append(QColor(19, 71, 90));
266 268 m_themeColors.append(QColor(110, 70, 228));
267 269
268 m_backgroundGradient.setColorAt(0.0, QColor(QRgb(0xffe4ffff)));
269 m_backgroundGradient.setColorAt(1.0, QColor(QRgb(0xffe4ffff)));
270 setBackground(QColor(QRgb(0xffe4ffff)), QColor(QRgb(0xffe4ffff)), VerticalGradientOrientation);
270 271 break;
271 272 case QChart::ChartThemeGrayscale:
272 273 m_themeColors.append(QColor(0, 0, 0));
@@ -275,8 +276,7 void QChart::setTheme(QChart::ChartThemeId theme)
275 276 m_themeColors.append(QColor(140, 140, 140));
276 277 m_themeColors.append(QColor(180, 180, 180));
277 278
278 m_backgroundGradient.setColorAt(0.0, QColor(QRgb(0xffffffff)));
279 m_backgroundGradient.setColorAt(1.0, QColor(QRgb(0xffafafaf)));
279 setBackground(QColor(QRgb(0xffffffff)), QColor(QRgb(0xffafafaf)), VerticalGradientOrientation);
280 280 break;
281 281 case QChart::ChartThemeUnnamed1:
282 282 m_themeColors.append(QColor(QRgb(0xff3fa9f5)));
@@ -285,8 +285,7 void QChart::setTheme(QChart::ChartThemeId theme)
285 285 m_themeColors.append(QColor(QRgb(0xffFF1D25)));
286 286 m_themeColors.append(QColor(QRgb(0xffFF7BAC)));
287 287
288 m_backgroundGradient.setColorAt(0.0, QColor(QRgb(0xfff3dc9e)));
289 m_backgroundGradient.setColorAt(1.0, QColor(QRgb(0xffafafaf)));
288 setBackground(QColor(QRgb(0xfff3dc9e)), QColor(QRgb(0xffafafaf)), VerticalGradientOrientation);
290 289 break;
291 290 default:
292 291 Q_ASSERT(false);
@@ -22,9 +22,11 public: // from QChartSeries
22 22
23 23 public Q_SLOTS:
24 24 void chartSizeChanged(QRectF rect);
25 // TODO: also affects opacity of the marker...? To be documented
25 26 void setMarkerColor(QColor color);
26 27 QColor markerColor();
27 //void chartScaleChanged(qreal xscale, qreal yscale);
28 // TODO: marker shapes: "x", star, rectangle, tilted rect, triangle, circle, dot
29 //void setMarkerShape(QChartSeries::MarkerShape/QScatterSeries::MarkerShape shape);
28 30
29 31 private:
30 32 Q_DECLARE_PRIVATE(QScatterSeries)
General Comments 0
You need to be logged in to leave comments. Login now