@@ -328,15 +328,6 void QChartView::keyPressEvent(QKeyEvent *event) | |||
|
328 | 328 | */ |
|
329 | 329 | void QChartView::setChartTheme(QChart::ChartTheme theme) |
|
330 | 330 | { |
|
331 | if (theme == QChart::ChartThemeBlueCerulean) { | |
|
332 | QLinearGradient backgroundGradient; | |
|
333 | backgroundGradient.setColorAt(0.0, QRgb(0x056188)); | |
|
334 | backgroundGradient.setColorAt(1.0, QRgb(0x101a33)); | |
|
335 | backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); | |
|
336 | setBackgroundBrush(backgroundGradient); | |
|
337 | } else { | |
|
338 | setBackgroundBrush(Qt::NoBrush); | |
|
339 | } | |
|
340 | 331 | m_chart->setChartTheme(theme); |
|
341 | 332 | } |
|
342 | 333 |
@@ -13,8 +13,12 public: | |||
|
13 | 13 | m_seriesColors << QRgb(0x4fbef3); |
|
14 | 14 | generateSeriesGradients(); |
|
15 | 15 | |
|
16 | // No chart background, chart view specifies a background | |
|
17 | // TODO: what if the chart is drawn on custom graphics scene instead of QChartView? | |
|
16 | // Background | |
|
17 | QLinearGradient backgroundGradient; | |
|
18 | backgroundGradient.setColorAt(0.0, QRgb(0x056188)); | |
|
19 | backgroundGradient.setColorAt(1.0, QRgb(0x101a33)); | |
|
20 | backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); | |
|
21 | m_chartBackgroundGradient = backgroundGradient; | |
|
18 | 22 | |
|
19 | 23 | // Axes and other |
|
20 | 24 | m_masterFont = QFont(); |
General Comments 0
You need to be logged in to leave comments.
Login now