##// END OF EJS Templates
tuning theme colors
Tero Ahola -
r125:d693628c68fb
parent child
Show More
@@ -22,7 +22,7 public:
22 22 ThemeVanilla,
23 23 ThemeIcy,
24 24 ThemeGrayscale,
25 //ThemeScientific,
25 ThemeScientific,
26 26 ThemeUnnamed1
27 27 };
28 28 DeclarativeChart(QDeclarativeItem *parent = 0);
@@ -33,26 +33,32 void ChartThemeData::setTheme(int theme)
33 33 m_gradientEndColor = QColor(QRgb(0xffafafaf));
34 34 break;
35 35 case QChart::ChartThemeIcy:
36 m_seriesThemes.append(SeriesTheme(QColor(0, 3, 165), 2));
37 m_seriesThemes.append(SeriesTheme(QColor(49, 52, 123), 2));
38 m_seriesThemes.append(SeriesTheme(QColor(71, 114, 187), 2));
39 m_seriesThemes.append(SeriesTheme(QColor(48, 97, 87), 2));
40 m_seriesThemes.append(SeriesTheme(QColor(19, 71, 90), 2));
41 m_seriesThemes.append(SeriesTheme(QColor(110, 70, 228), 2));
36 m_seriesThemes.append(SeriesTheme(QRgb(0xFF0D2673), 2));
37 m_seriesThemes.append(SeriesTheme(QRgb(0xFF2685BF), 2));
38 m_seriesThemes.append(SeriesTheme(QRgb(0xFF3DADD9), 3));
39 m_seriesThemes.append(SeriesTheme(QRgb(0xFF62C3D9), 2));
42 40
43 m_gradientStartColor = QColor(QRgb(0xffe4ffff));
44 m_gradientEndColor = QColor(QRgb(0xffe4ffff));
41 m_gradientStartColor = QColor(QRgb(0xffBDE3F2));
42 m_gradientEndColor = QColor(QRgb(0xffafafaf));
45 43 break;
46 44 case QChart::ChartThemeGrayscale:
47 m_seriesThemes.append(SeriesTheme(QColor(0, 0, 0), 2));
48 m_seriesThemes.append(SeriesTheme(QColor(50, 50, 50), 2));
49 m_seriesThemes.append(SeriesTheme(QColor(100, 100, 100), 2));
50 m_seriesThemes.append(SeriesTheme(QColor(140, 140, 140), 2));
51 m_seriesThemes.append(SeriesTheme(QColor(180, 180, 180), 2));
45 m_seriesThemes.append(SeriesTheme(QRgb(0xFF869299), 2));
46 m_seriesThemes.append(SeriesTheme(QRgb(0xFFA5BDCC), 2));
47 m_seriesThemes.append(SeriesTheme(QRgb(0xFFE8FFFC), 3));
48 m_seriesThemes.append(SeriesTheme(QRgb(0xFFCCC2C2), 2));
52 49
53 50 m_gradientStartColor = QColor(QRgb(0xffffffff));
54 51 m_gradientEndColor = QColor(QRgb(0xffafafaf));
55 52 break;
53 case QChart::ChartThemeScientific:
54 m_seriesThemes.append(SeriesTheme(QRgb(0xFF000000), 3));
55 m_seriesThemes.append(SeriesTheme(QRgb(0xFFFFAD00), 2));
56 m_seriesThemes.append(SeriesTheme(QRgb(0xFF596A75), 2));
57 m_seriesThemes.append(SeriesTheme(QRgb(0xFF474747), 2));
58
59 m_gradientStartColor = QColor(QRgb(0xffafafaf));
60 m_gradientEndColor = QColor(QRgb(0xffafafaf));
61 break;
56 62 case QChart::ChartThemeUnnamed1:
57 63 m_seriesThemes.append(SeriesTheme(QColor(QRgb(0xff3fa9f5)), 2));
58 64 m_seriesThemes.append(SeriesTheme(QColor(QRgb(0xff7AC943)), 2));
@@ -42,7 +42,7 public:
42 42 ChartThemeVanilla,
43 43 ChartThemeIcy,
44 44 ChartThemeGrayscale,
45 //ChartThemeScientific,
45 ChartThemeScientific,
46 46 ChartThemeUnnamed1
47 47 };
48 48
@@ -124,6 +124,7 void MainWidget::initThemeCombo(QGridLayout *grid)
124 124 chartTheme->addItem("Vanilla");
125 125 chartTheme->addItem("Icy");
126 126 chartTheme->addItem("Grayscale");
127 chartTheme->addItem("Scientific");
127 128 chartTheme->addItem("Unnamed1");
128 129 connect(chartTheme, SIGNAL(currentIndexChanged(int)),
129 130 this, SLOT(changeChartTheme(int)));
@@ -9,52 +9,6 Rectangle {
9 9 anchors.centerIn: parent
10 10 }
11 11
12 // Component.onCompleted: {
13 // for (var i = 0.0; i < 100.0; i += 0.1) {
14 // var x = i + Math.random() * 5;
15 // var y = Math.abs(Math.sin(3.14159 / 50 * x) * 100) + (Math.random() * 5);
16 // myData.append({'x':x, 'y':y});
17 // }
18 // }
19
20 // ChartModel {
21 // id: chartData
22 // ChartElement {
23 // y: 1.2
24 // }
25 // ChartElement {
26 // x: 1.1
27 // y: 1.2
28 // }
29 // ChartElement {
30 // label: "February"
31 // y: 1.2
32 // }
33 // ChartElement {
34 // label: "January"
35 // x: 0.2
36 // y: 2.1
37 // }
38 // }
39
40 // Series {
41 // model: chartData
42 // seriesType: pie
43 // axis: Series.AxisSecondaryY
44 // }
45
46 ListModel {
47 id: myData
48 ListElement {
49 nnn: 55.2
50 mmm: 13.1
51 }
52 ListElement {
53 nnn: 15.3
54 mmm: 3.4
55 }
56 }
57
58 12 Chart {
59 13 anchors.fill: parent
60 14 theme: Chart.ThemeIcy
General Comments 0
You need to be logged in to leave comments. Login now