@@ -93,20 +93,30 void ChartTheme::decorate(QLegend* legend) | |||
|
93 | 93 | |
|
94 | 94 | void ChartTheme::decorate(QAreaSeries* series, int index) |
|
95 | 95 | { |
|
96 | QPen pen(colorAt(m_seriesGradients.at(index % m_seriesGradients.size()), 1.0)); | |
|
97 | pen.setWidthF(2); | |
|
98 | series->setPen(pen); | |
|
96 | QPen pen; | |
|
97 | QBrush brush; | |
|
99 | 98 | |
|
100 | QBrush brush(m_seriesColors.at(index % m_seriesColors.size())); | |
|
101 | series->setBrush(brush); | |
|
99 | if (pen == series->pen()){ | |
|
100 | pen.setColor(colorAt(m_seriesGradients.at(index % m_seriesGradients.size()), 1.0)); | |
|
101 | pen.setWidthF(2); | |
|
102 | series->setPen(pen); | |
|
103 | } | |
|
104 | ||
|
105 | if (brush == series->brush()) { | |
|
106 | QBrush brush(m_seriesColors.at(index % m_seriesColors.size())); | |
|
107 | series->setBrush(brush); | |
|
108 | } | |
|
102 | 109 | } |
|
103 | 110 | |
|
104 | 111 | |
|
105 | 112 | void ChartTheme::decorate(QLineSeries* series,int index) |
|
106 | 113 | { |
|
107 | QPen pen(m_seriesColors.at(index%m_seriesColors.size())); | |
|
108 | pen.setWidthF(2); | |
|
109 | series->setPen(pen); | |
|
114 | QPen pen; | |
|
115 | if(pen == series->pen()){ | |
|
116 | pen.setColor(m_seriesColors.at(index%m_seriesColors.size())); | |
|
117 | pen.setWidthF(2); | |
|
118 | series->setPen(pen); | |
|
119 | } | |
|
110 | 120 | } |
|
111 | 121 | |
|
112 | 122 | void ChartTheme::decorate(QBarSeries* series,int index) |
@@ -171,12 +181,20 void ChartTheme::decorate(QPercentBarSeries* series,int index) | |||
|
171 | 181 | |
|
172 | 182 | void ChartTheme::decorate(QScatterSeries* series, int index) |
|
173 | 183 | { |
|
174 | QPen pen(colorAt(m_seriesGradients.at(index % m_seriesGradients.size()), 1.0)); | |
|
175 | pen.setWidthF(2); | |
|
176 | series->setPen(pen); | |
|
177 | 184 | |
|
178 | QBrush brush(m_seriesColors.at(index % m_seriesColors.size())); | |
|
179 |
|
|
|
185 | QPen pen; | |
|
186 | QBrush brush; | |
|
187 | ||
|
188 | if (pen == series->pen()) { | |
|
189 | pen.setColor(colorAt(m_seriesGradients.at(index % m_seriesGradients.size()), 1.0)); | |
|
190 | pen.setWidthF(2); | |
|
191 | series->setPen(pen); | |
|
192 | } | |
|
193 | ||
|
194 | if (brush == series->brush()) { | |
|
195 | QBrush brush(m_seriesColors.at(index % m_seriesColors.size())); | |
|
196 | series->setBrush(brush); | |
|
197 | } | |
|
180 | 198 | } |
|
181 | 199 | |
|
182 | 200 | void ChartTheme::decorate(QPieSeries* series, int index) |
@@ -193,9 +211,12 void ChartTheme::decorate(QPieSeries* series, int index) | |||
|
193 | 211 | |
|
194 | 212 | void ChartTheme::decorate(QSplineSeries* series, int index) |
|
195 | 213 | { |
|
196 | QPen pen(m_seriesColors.at(index%m_seriesColors.size())); | |
|
197 | pen.setWidthF(2); | |
|
198 | series->setPen(pen); | |
|
214 | QPen pen; | |
|
215 | if(pen == series->pen()){ | |
|
216 | pen.setColor(m_seriesColors.at(index%m_seriesColors.size())); | |
|
217 | pen.setWidthF(2); | |
|
218 | series->setPen(pen); | |
|
219 | } | |
|
199 | 220 | } |
|
200 | 221 | |
|
201 | 222 | void ChartTheme::decorate(QChartAxis* axis,bool axisX) |
General Comments 0
You need to be logged in to leave comments.
Login now