##// END OF EJS Templates
Using new theme in barcharts
sauimone -
r509:26832e993d66
parent child
Show More
@@ -156,24 +156,30 void ChartTheme::decorate(LineChartItem* item, QLineSeries* series,int count)
156 void ChartTheme::decorate(BarPresenter* item, QBarSeries* series,int count)
156 void ChartTheme::decorate(BarPresenter* item, QBarSeries* series,int count)
157 {
157 {
158 QList<QBarSet*> sets = series->barSets();
158 QList<QBarSet*> sets = series->barSets();
159 for (int i=0; i<series->barsetCount(); i++) {
159 for (int i=0; i<sets.count(); i++) {
160 sets.at(i)->setBrush(QBrush(m_seriesColors.at(i%m_seriesColors.count())));
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 void ChartTheme::decorate(StackedBarPresenter* item, QStackedBarSeries* series,int count)
166 void ChartTheme::decorate(StackedBarPresenter* item, QStackedBarSeries* series,int count)
165 {
167 {
166 QList<QBarSet*> sets = series->barSets();
168 QList<QBarSet*> sets = series->barSets();
167 for (int i=0; i<series->barsetCount(); i++) {
169 for (int i=0; i<sets.count(); i++) {
168 sets.at(i)->setBrush(QBrush(m_seriesColors.at(i%m_seriesColors.count())));
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 void ChartTheme::decorate(PercentBarPresenter* item, QPercentBarSeries* series,int count)
176 void ChartTheme::decorate(PercentBarPresenter* item, QPercentBarSeries* series,int count)
173 {
177 {
174 QList<QBarSet*> sets = series->barSets();
178 QList<QBarSet*> sets = series->barSets();
175 for (int i=0; i<series->barsetCount(); i++) {
179 for (int i=0; i<sets.count(); i++) {
176 sets.at(i)->setBrush(QBrush(m_seriesColors.at(i%m_seriesColors.count())));
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