|
@@ -767,33 +767,33 @@ def drawLines(self, width=None, dash=None, linecap='butt', linejoin='miter'): |
|
|
'bevel' : cairo.LINE_JOIN_BEVEL,
|
|
|
}[linejoin])
|
|
|
|
|
|
+ # check whether there is an stacked metric
|
|
|
+ singleStacked = False
|
|
|
+ for series in self.data:
|
|
|
+ if 'stacked' in series.options:
|
|
|
+ singleStacked = True
|
|
|
+ if singleStacked:
|
|
|
+ self.data = sort_stacked(self.data)
|
|
|
+
|
|
|
# stack the values
|
|
|
if self.areaMode == 'stacked' and not self.secondYAxis: #TODO Allow stacked area mode with secondYAxis
|
|
|
total = []
|
|
|
for series in self.data:
|
|
|
if 'drawAsInfinite' in series.options:
|
|
|
continue
|
|
|
+
|
|
|
+ series.options['stacked'] = True
|
|
|
for i in range(len(series)):
|
|
|
if len(total) <= i: total.append(0)
|
|
|
|
|
|
if series[i] is not None:
|
|
|
original = series[i]
|
|
|
series[i] += total[i]
|
|
|
total[i] += original
|
|
|
-
|
|
|
- # check whether there is an stacked metric
|
|
|
- singleStacked = False
|
|
|
- for series in self.data:
|
|
|
- if 'stacked' in series.options:
|
|
|
- singleStacked = True
|
|
|
- if singleStacked:
|
|
|
- self.data = sort_stacked(self.data)
|
|
|
-
|
|
|
- # apply stacked setting on series based on areaMode
|
|
|
- if self.areaMode == 'first':
|
|
|
+ elif self.areaMode == 'first':
|
|
|
self.data[0].options['stacked'] = True
|
|
|
- elif self.areaMode != 'none':
|
|
|
- for series in self.data:
|
|
|
+ elif self.areaMode == 'all':
|
|
|
+ if 'drawAsInfinite' not in series.options:
|
|
|
series.options['stacked'] = True
|
|
|
|
|
|
# apply alpha channel and create separate stroke series
|
|
|
This comment has been minimized.
Show comment Hide commentpiotr1212Apr 27, 2013
Contributorthis commit breaks areaMode=all. When using areaMode=all it seems that only the last series is drawn with filled area. fixed in #307
piotr1212 commented onApr 27, 2013
a8dd81a
this commit breaks areaMode=all. When using areaMode=all it seems that only the last series is drawn with filled area. fixed in #307