@@ -24,7 +24,7 QChart::QChart(QGraphicsObject* parent) : QGraphicsObject(parent), | |||||
24 | m_marginSize(0) |
|
24 | m_marginSize(0) | |
25 | { |
|
25 | { | |
26 | // TODO: the default theme? |
|
26 | // TODO: the default theme? | |
27 |
|
|
27 | setTheme(QChart::ChartThemeDefault); | |
28 |
|
28 | |||
29 | PlotDomain domain; |
|
29 | PlotDomain domain; | |
30 | m_plotDomainList<<domain; |
|
30 | m_plotDomainList<<domain; | |
@@ -246,7 +246,10 void QChart::setTheme(QChart::ChartThemeId theme) | |||||
246 | switch (theme) { |
|
246 | switch (theme) { | |
247 | case QChart::ChartThemeDefault: |
|
247 | case QChart::ChartThemeDefault: | |
248 | // TODO: define the default theme based on the OS |
|
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 | case QChart::ChartThemeVanilla: |
|
253 | case QChart::ChartThemeVanilla: | |
251 | m_themeColors.append(QColor(217, 197, 116)); |
|
254 | m_themeColors.append(QColor(217, 197, 116)); | |
252 | m_themeColors.append(QColor(214, 168, 150)); |
|
255 | m_themeColors.append(QColor(214, 168, 150)); | |
@@ -254,8 +257,7 void QChart::setTheme(QChart::ChartThemeId theme) | |||||
254 | m_themeColors.append(QColor(210, 210, 52)); |
|
257 | m_themeColors.append(QColor(210, 210, 52)); | |
255 | m_themeColors.append(QColor(136, 114, 58)); |
|
258 | m_themeColors.append(QColor(136, 114, 58)); | |
256 |
|
259 | |||
257 | m_backgroundGradient.setColorAt(0.0, QColor(QRgb(0xff9d844d))); |
|
260 | setBackground(QColor(QRgb(0xff9d844d)), QColor(QRgb(0xffafafaf)), VerticalGradientOrientation); | |
258 | m_backgroundGradient.setColorAt(1.0, QColor(QRgb(0xffafafaf))); |
|
|||
259 | break; |
|
261 | break; | |
260 | case QChart::ChartThemeIcy: |
|
262 | case QChart::ChartThemeIcy: | |
261 | m_themeColors.append(QColor(0, 3, 165)); |
|
263 | m_themeColors.append(QColor(0, 3, 165)); | |
@@ -265,8 +267,7 void QChart::setTheme(QChart::ChartThemeId theme) | |||||
265 | m_themeColors.append(QColor(19, 71, 90)); |
|
267 | m_themeColors.append(QColor(19, 71, 90)); | |
266 | m_themeColors.append(QColor(110, 70, 228)); |
|
268 | m_themeColors.append(QColor(110, 70, 228)); | |
267 |
|
269 | |||
268 | m_backgroundGradient.setColorAt(0.0, QColor(QRgb(0xffe4ffff))); |
|
270 | setBackground(QColor(QRgb(0xffe4ffff)), QColor(QRgb(0xffe4ffff)), VerticalGradientOrientation); | |
269 | m_backgroundGradient.setColorAt(1.0, QColor(QRgb(0xffe4ffff))); |
|
|||
270 | break; |
|
271 | break; | |
271 | case QChart::ChartThemeGrayscale: |
|
272 | case QChart::ChartThemeGrayscale: | |
272 | m_themeColors.append(QColor(0, 0, 0)); |
|
273 | m_themeColors.append(QColor(0, 0, 0)); | |
@@ -275,8 +276,7 void QChart::setTheme(QChart::ChartThemeId theme) | |||||
275 | m_themeColors.append(QColor(140, 140, 140)); |
|
276 | m_themeColors.append(QColor(140, 140, 140)); | |
276 | m_themeColors.append(QColor(180, 180, 180)); |
|
277 | m_themeColors.append(QColor(180, 180, 180)); | |
277 |
|
278 | |||
278 | m_backgroundGradient.setColorAt(0.0, QColor(QRgb(0xffffffff))); |
|
279 | setBackground(QColor(QRgb(0xffffffff)), QColor(QRgb(0xffafafaf)), VerticalGradientOrientation); | |
279 | m_backgroundGradient.setColorAt(1.0, QColor(QRgb(0xffafafaf))); |
|
|||
280 | break; |
|
280 | break; | |
281 | case QChart::ChartThemeUnnamed1: |
|
281 | case QChart::ChartThemeUnnamed1: | |
282 | m_themeColors.append(QColor(QRgb(0xff3fa9f5))); |
|
282 | m_themeColors.append(QColor(QRgb(0xff3fa9f5))); | |
@@ -285,8 +285,7 void QChart::setTheme(QChart::ChartThemeId theme) | |||||
285 | m_themeColors.append(QColor(QRgb(0xffFF1D25))); |
|
285 | m_themeColors.append(QColor(QRgb(0xffFF1D25))); | |
286 | m_themeColors.append(QColor(QRgb(0xffFF7BAC))); |
|
286 | m_themeColors.append(QColor(QRgb(0xffFF7BAC))); | |
287 |
|
287 | |||
288 | m_backgroundGradient.setColorAt(0.0, QColor(QRgb(0xfff3dc9e))); |
|
288 | setBackground(QColor(QRgb(0xfff3dc9e)), QColor(QRgb(0xffafafaf)), VerticalGradientOrientation); | |
289 | m_backgroundGradient.setColorAt(1.0, QColor(QRgb(0xffafafaf))); |
|
|||
290 | break; |
|
289 | break; | |
291 | default: |
|
290 | default: | |
292 | Q_ASSERT(false); |
|
291 | Q_ASSERT(false); |
@@ -22,9 +22,11 public: // from QChartSeries | |||||
22 |
|
22 | |||
23 | public Q_SLOTS: |
|
23 | public Q_SLOTS: | |
24 | void chartSizeChanged(QRectF rect); |
|
24 | void chartSizeChanged(QRectF rect); | |
|
25 | // TODO: also affects opacity of the marker...? To be documented | |||
25 | void setMarkerColor(QColor color); |
|
26 | void setMarkerColor(QColor color); | |
26 | QColor markerColor(); |
|
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 | private: |
|
31 | private: | |
30 | Q_DECLARE_PRIVATE(QScatterSeries) |
|
32 | Q_DECLARE_PRIVATE(QScatterSeries) |
General Comments 0
You need to be logged in to leave comments.
Login now