diff --git a/src/charttheme.cpp b/src/charttheme.cpp index 67c2af9..6ecb82f 100644 --- a/src/charttheme.cpp +++ b/src/charttheme.cpp @@ -157,7 +157,9 @@ void ChartTheme::decorate(BarPresenter* item, QBarSeries* series,int count) { QList sets = series->barSets(); for (int i=0; i 1) + pos = (qreal) i / (qreal) (sets.count() - 1); QColor c = colorAt(m_seriesGradients.at(count % m_seriesGradients.size()), pos); sets.at(i)->setBrush(QBrush(c)); @@ -177,7 +179,9 @@ void ChartTheme::decorate(StackedBarPresenter* item, QStackedBarSeries* series,i { QList sets = series->barSets(); for (int i=0; i 1) + pos = (qreal) i / (qreal) (sets.count() - 1); QColor c = colorAt(m_seriesGradients.at(count % m_seriesGradients.size()), pos); sets.at(i)->setBrush(QBrush(c)); @@ -194,7 +198,9 @@ void ChartTheme::decorate(PercentBarPresenter* item, QPercentBarSeries* series,i { QList sets = series->barSets(); for (int i=0; i 1) + pos = (qreal) i / (qreal) (sets.count() - 1); QColor c = colorAt(m_seriesGradients.at(count % m_seriesGradients.size()), pos); sets.at(i)->setBrush(QBrush(c)); diff --git a/src/themes/chartthemescientific_p.h b/src/themes/chartthemescientific_p.h index d6c486a..8115ee5 100644 --- a/src/themes/chartthemescientific_p.h +++ b/src/themes/chartthemescientific_p.h @@ -7,25 +7,12 @@ class ChartThemeScientific: public ChartTheme public: ChartThemeScientific():ChartTheme(QChart::ChartThemeScientific) { - m_seriesColors << QRgb(0xFF000000); m_seriesColors << QRgb(0xFFFFAD00); m_seriesColors << QRgb(0xFF596A75); + m_seriesColors << QRgb(0xFF202020); m_seriesColors << QRgb(0xFF474747); - QLinearGradient g1; - g1.setColorAt(0.0, m_seriesColors.at(0)); - g1.setColorAt(1.0, m_seriesColors.at(1)); - m_seriesGradients << g1; - - QLinearGradient g2; - g2.setColorAt(0.0, m_seriesColors.at(1)); - g2.setColorAt(1.0, m_seriesColors.at(2)); - m_seriesGradients << g2; - - QLinearGradient g3; - g3.setColorAt(0.0, m_seriesColors.at(2)); - g3.setColorAt(1.0, m_seriesColors.at(3)); - m_seriesGradients << g3; + generateSeriesGradients(); QLinearGradient backgroundGradient; backgroundGradient.setColorAt(0.0, QRgb(0xffafafaf));