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