@@ -205,9 +205,10 void ChartTheme::decorate(PiePresenter* item, QPieSeries* series, int count) | |||
|
205 | 205 | // Get color for a slice from a gradient linearly, beginning from the start of the gradient |
|
206 | 206 | for (int i(0); i < series->slices().count(); i++) { |
|
207 | 207 | qreal pos = (qreal) i / (qreal) series->count(); |
|
208 |
QColor |
|
|
209 |
series->slices().at(i)->setSlicePen( |
|
|
210 | series->slices().at(i)->setSliceBrush(c); | |
|
208 | QColor penColor = colorAt(m_seriesGradients.at(count % m_seriesGradients.size()), 0.1); | |
|
209 | series->slices().at(i)->setSlicePen(penColor); | |
|
210 | QColor brushColor = colorAt(m_seriesGradients.at(count % m_seriesGradients.size()), pos); | |
|
211 | series->slices().at(i)->setSliceBrush(brushColor); | |
|
211 | 212 | } |
|
212 | 213 | } |
|
213 | 214 |
@@ -168,7 +168,7 QList<RealList> MainWidget::generateTestData(int columnCount, int rowCount, QStr | |||
|
168 | 168 | } else if (dataCharacteristics == "Sin + random") { |
|
169 | 169 | newColumn.append(abs(sin(3.14159265358979 / 50 * i) * 100) + (rand() % 5)); |
|
170 | 170 | } else if (dataCharacteristics == "Random") { |
|
171 |
newColumn.append(rand() % |
|
|
171 | newColumn.append(rand() % 10 + (qreal) rand() / (qreal) RAND_MAX); | |
|
172 | 172 | } else if (dataCharacteristics == "Linear") { |
|
173 | 173 | //newColumn.append(i * (j + 1.0)); |
|
174 | 174 | // TODO: temporary hack to make pie work; prevent zero values: |
General Comments 0
You need to be logged in to leave comments.
Login now