Skip to content

Instantly share code, notes, and snippets.

@mleinart
Created March 15, 2013 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mleinart/5172969 to your computer and use it in GitHub Desktop.
Save mleinart/5172969 to your computer and use it in GitHub Desktop.
diff --git a/webapp/graphite/render/glyph.py b/webapp/graphite/render/glyph.py
index 15ceb0d..23482a7 100644
--- a/webapp/graphite/render/glyph.py
+++ b/webapp/graphite/render/glyph.py
@@ -751,10 +751,22 @@ class LineGraph(Graph):
'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)
@@ -762,20 +774,10 @@ class LineGraph(Graph):
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment