@@ -99,7 +99,7 public: | |||||
99 |
|
99 | |||
100 | // bar chart |
|
100 | // bar chart | |
101 | chart = new QChartView(); |
|
101 | chart = new QChartView(); | |
102 |
chart->setChartTitle(" |
|
102 | chart->setChartTitle("Bar chart"); | |
103 | baseLayout->addWidget(chart, 1, 1); |
|
103 | baseLayout->addWidget(chart, 1, 1); | |
104 | { |
|
104 | { | |
105 | QStringList categories; |
|
105 | QStringList categories; | |
@@ -121,7 +121,7 public: | |||||
121 |
|
121 | |||
122 | // line chart |
|
122 | // line chart | |
123 | chart = new QChartView(); |
|
123 | chart = new QChartView(); | |
124 |
chart->setChartTitle(" |
|
124 | chart->setChartTitle("Line chart"); | |
125 | baseLayout->addWidget(chart, 1, 2); |
|
125 | baseLayout->addWidget(chart, 1, 2); | |
126 | foreach (DataList list, m_dataTable) { |
|
126 | foreach (DataList list, m_dataTable) { | |
127 | QLineSeries *series = new QLineSeries(chart); |
|
127 | QLineSeries *series = new QLineSeries(chart); | |
@@ -133,7 +133,8 public: | |||||
133 |
|
133 | |||
134 | // pie chart |
|
134 | // pie chart | |
135 | chart = new QChartView(); |
|
135 | chart = new QChartView(); | |
136 | chart->setChartTitle("pie chart"); |
|
136 | chart->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); // funny things happen if the pie slice labels no not fit the screen... | |
|
137 | chart->setChartTitle("Pie chart"); | |||
137 | baseLayout->addWidget(chart, 2, 0); |
|
138 | baseLayout->addWidget(chart, 2, 0); | |
138 | qreal pieSize = 1.0 / m_dataTable.count(); |
|
139 | qreal pieSize = 1.0 / m_dataTable.count(); | |
139 | for (int i=0; i<m_dataTable.count(); i++) { |
|
140 | for (int i=0; i<m_dataTable.count(); i++) { | |
@@ -154,7 +155,7 public: | |||||
154 |
|
155 | |||
155 | // spine chart |
|
156 | // spine chart | |
156 | chart = new QChartView(); |
|
157 | chart = new QChartView(); | |
157 |
chart->setChartTitle(" |
|
158 | chart->setChartTitle("Spline chart"); | |
158 | baseLayout->addWidget(chart, 2, 1); |
|
159 | baseLayout->addWidget(chart, 2, 1); | |
159 | foreach (DataList list, m_dataTable) { |
|
160 | foreach (DataList list, m_dataTable) { | |
160 | QSplineSeries *series = new QSplineSeries(chart); |
|
161 | QSplineSeries *series = new QSplineSeries(chart); | |
@@ -166,7 +167,7 public: | |||||
166 |
|
167 | |||
167 | // scatter chart |
|
168 | // scatter chart | |
168 | chart = new QChartView(); |
|
169 | chart = new QChartView(); | |
169 |
chart->setChartTitle(" |
|
170 | chart->setChartTitle("Scatter chart"); | |
170 | baseLayout->addWidget(chart, 2, 2); |
|
171 | baseLayout->addWidget(chart, 2, 2); | |
171 | foreach (DataList list, m_dataTable) { |
|
172 | foreach (DataList list, m_dataTable) { | |
172 | QScatterSeries *series = new QScatterSeries(chart); |
|
173 | QScatterSeries *series = new QScatterSeries(chart); |
General Comments 0
You need to be logged in to leave comments.
Login now