bd808 / graphite-graph-php

PHP DSL for generating Graphite graph specifications
http://bd808.com/graphite-graph-php
BSD 2-Clause "Simplified" License
16 stars 6 forks source link

Figure out how to draw in+out stacked graphs #10

Open bd808 opened 12 years ago

bd808 commented 12 years ago

We draw graphs in cacti where io in and io out are shown in the same graph with two area series: from 0 -> input and from 0 -> -output.

scale(series,-1) will flip the output data points, but drawing the two as stacked doesn't do what I want. Both areas start from yMin instead of from 0.

areaBetween() sounds promising, but so far I haven't been able to make it work like my brain expects.

Read through the renderer source in Graphite and see if what I want is possible. If it is document it. If it's not make a patch!

bd808 commented 12 years ago

areaBetween takes one argument which must be a seriesList with exactly 2 series. The first in the list is called lower and the second is upper. Lower is given the option invisible which sets the alpha of the series color to 0.

upper.pathExpression must exist, so if you're using a constantLine() you'll have to wrap it in something like movingAverage() to fake that.

bd808 commented 12 years ago

Got it working fine for "up" series, but no luck yet for an inverted (scale(-1)) series.