@@ -156,24 +156,30 void ChartTheme::decorate(LineChartItem* item, QLineSeries* series,int count) | |||
|
156 | 156 | void ChartTheme::decorate(BarPresenter* item, QBarSeries* series,int count) |
|
157 | 157 | { |
|
158 | 158 | QList<QBarSet*> sets = series->barSets(); |
|
159 |
for (int i=0; i<se |
|
|
160 | sets.at(i)->setBrush(QBrush(m_seriesColors.at(i%m_seriesColors.count()))); | |
|
159 | for (int i=0; i<sets.count(); i++) { | |
|
160 | qreal pos = (qreal) i / (qreal) sets.count(); | |
|
161 | QColor c = colorAt(m_seriesGradients.at(count % m_seriesGradients.size()), pos); | |
|
162 | sets.at(i)->setBrush(QBrush(c)); | |
|
161 | 163 | } |
|
162 | 164 | } |
|
163 | 165 | |
|
164 | 166 | void ChartTheme::decorate(StackedBarPresenter* item, QStackedBarSeries* series,int count) |
|
165 | 167 | { |
|
166 | 168 | QList<QBarSet*> sets = series->barSets(); |
|
167 |
for (int i=0; i<se |
|
|
168 | sets.at(i)->setBrush(QBrush(m_seriesColors.at(i%m_seriesColors.count()))); | |
|
169 | for (int i=0; i<sets.count(); i++) { | |
|
170 | qreal pos = (qreal) i / (qreal) sets.count(); | |
|
171 | QColor c = colorAt(m_seriesGradients.at(count % m_seriesGradients.size()), pos); | |
|
172 | sets.at(i)->setBrush(QBrush(c)); | |
|
169 | 173 | } |
|
170 | 174 | } |
|
171 | 175 | |
|
172 | 176 | void ChartTheme::decorate(PercentBarPresenter* item, QPercentBarSeries* series,int count) |
|
173 | 177 | { |
|
174 | 178 | QList<QBarSet*> sets = series->barSets(); |
|
175 |
for (int i=0; i<se |
|
|
176 | sets.at(i)->setBrush(QBrush(m_seriesColors.at(i%m_seriesColors.count()))); | |
|
179 | for (int i=0; i<sets.count(); i++) { | |
|
180 | qreal pos = (qreal) i / (qreal) sets.count(); | |
|
181 | QColor c = colorAt(m_seriesGradients.at(count % m_seriesGradients.size()), pos); | |
|
182 | sets.at(i)->setBrush(QBrush(c)); | |
|
177 | 183 | } |
|
178 | 184 | } |
|
179 | 185 |
General Comments 0
You need to be logged in to leave comments.
Login now