##// END OF EJS Templates
Tuning example code for better screen shots
Tero Ahola -
r343:babaf6244e0f
parent child
Show More
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -19,6 +19,7 int main(int argc, char *argv[])
19 // Create chart view
19 // Create chart view
20 QChartView *chartView = new QChartView();
20 QChartView *chartView = new QChartView();
21 chartView->setRenderHint(QPainter::Antialiasing);
21 chartView->setRenderHint(QPainter::Antialiasing);
22 chartView->setChartTitle("Simple Line Chart");
22 // Add series to the chart
23 // Add series to the chart
23 QLineChartSeries *line = new QLineChartSeries();
24 QLineChartSeries *line = new QLineChartSeries();
24 line->add(0.0, 0.8);
25 line->add(0.0, 0.8);
@@ -27,11 +28,13 int main(int argc, char *argv[])
27 chartView->addSeries(line);
28 chartView->addSeries(line);
28 //! [1]
29 //! [1]
29
30
31 chartView->setChartTitle("\'Scietific\' theme");
30 //! [2]
32 //! [2]
31 // Change theme
33 // Change theme
32 chartView->setChartTheme(QChart::ChartThemeScientific);
34 chartView->setChartTheme(QChart::ChartThemeScientific);
33 //! [2]
35 //! [2]
34
36
37 chartView->setChartTitle("Simple Pie Chart");
35 //! [3]
38 //! [3]
36 // Add pie series
39 // Add pie series
37 // ...
40 // ...
@@ -41,6 +44,7 int main(int argc, char *argv[])
41 chartView->addSeries(pie);
44 chartView->addSeries(pie);
42 //! [3]
45 //! [3]
43
46
47 chartView->setChartTitle("Simple Scatter Chart");
44 //! [4]
48 //! [4]
45 // Add scatter series
49 // Add scatter series
46 // ...
50 // ...
@@ -52,6 +56,7 int main(int argc, char *argv[])
52 chartView->addSeries(scatter);
56 chartView->addSeries(scatter);
53 //! [4]
57 //! [4]
54
58
59 chartView->setChartTitle("Simple Bar Chart");
55 //! [5]
60 //! [5]
56 // ...
61 // ...
57 // Add bar series
62 // Add bar series
@@ -69,8 +74,9 int main(int argc, char *argv[])
69 //! [5]
74 //! [5]
70
75
71 QMainWindow w;
76 QMainWindow w;
72 w.resize(380, 250);
77 w.resize(400, 300);
73 w.setCentralWidget(chartView);
78 w.setCentralWidget(chartView);
79 w.setWindowFlags(Qt::FramelessWindowHint);
74 w.show();
80 w.show();
75
81
76 return a.exec();
82 return a.exec();
General Comments 0
You need to be logged in to leave comments. Login now