##// END OF EJS Templates
Pie pen now uses gradient start color
Tero Ahola -
r510:abde8123ae71
parent child
Show More
@@ -205,9 +205,10 void ChartTheme::decorate(PiePresenter* item, QPieSeries* series, int count)
205 // Get color for a slice from a gradient linearly, beginning from the start of the gradient
205 // Get color for a slice from a gradient linearly, beginning from the start of the gradient
206 for (int i(0); i < series->slices().count(); i++) {
206 for (int i(0); i < series->slices().count(); i++) {
207 qreal pos = (qreal) i / (qreal) series->count();
207 qreal pos = (qreal) i / (qreal) series->count();
208 QColor c = colorAt(m_seriesGradients.at(count % m_seriesGradients.size()), pos);
208 QColor penColor = colorAt(m_seriesGradients.at(count % m_seriesGradients.size()), 0.1);
209 series->slices().at(i)->setSlicePen(c);
209 series->slices().at(i)->setSlicePen(penColor);
210 series->slices().at(i)->setSliceBrush(c);
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 } else if (dataCharacteristics == "Sin + random") {
168 } else if (dataCharacteristics == "Sin + random") {
169 newColumn.append(abs(sin(3.14159265358979 / 50 * i) * 100) + (rand() % 5));
169 newColumn.append(abs(sin(3.14159265358979 / 50 * i) * 100) + (rand() % 5));
170 } else if (dataCharacteristics == "Random") {
170 } else if (dataCharacteristics == "Random") {
171 newColumn.append(rand() % 5);
171 newColumn.append(rand() % 10 + (qreal) rand() / (qreal) RAND_MAX);
172 } else if (dataCharacteristics == "Linear") {
172 } else if (dataCharacteristics == "Linear") {
173 //newColumn.append(i * (j + 1.0));
173 //newColumn.append(i * (j + 1.0));
174 // TODO: temporary hack to make pie work; prevent zero values:
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