manuelluis / jsrrdgraph

javascript rrdgraph
61 stars 12 forks source link

STACK works with LINE but not with AREA #20

Closed clement-parisot closed 9 years ago

clement-parisot commented 9 years ago

Hello,

I try to use this library to draw several stacked Areas. I use your test 1: https://manuelluis.github.io/jsrrdgraph/test/test1.html not-stack It seems to work perfectly with lines as you can see here: stack-lines But areas seems to be supperposed: stack-area

This is the code I use to test the feature (just add STACK and replace LINE by AREA):

-s end-1h
-e 1305798665
-w 600
-h 120
-v "System load"
-t Load
-E
DEF:s_avg=data/load.rrd:shortterm:AVERAGE
DEF:s_min=data/load.rrd:shortterm:MIN
DEF:s_max=data/load.rrd:shortterm:MAX
DEF:m_avg=data/load.rrd:midterm:AVERAGE
DEF:m_min=data/load.rrd:midterm:MIN
DEF:m_max=data/load.rrd:midterm:MAX
DEF:l_avg=data/load.rrd:longterm:AVERAGE
DEF:l_min=data/load.rrd:longterm:MIN
DEF:l_max=data/load.rrd:longterm:MAX
AREA:s_max#B7EFB7
AREA:s_min#FFFFFF
"AREA:s_avg#00E000: 1m average"
"GPRINT:s_min:MIN:%4.2lf Min,"
"GPRINT:s_avg:AVERAGE:%4.2lf Avg,"
"GPRINT:s_max:MAX:%4.2lf Max,"
"GPRINT:s_avg:LAST:%4.2lf Last\n"
"AREA:m_avg#0000FF: 5m average:STACK"
"GPRINT:m_min:MIN:%4.2lf Min,"
"GPRINT:m_avg:AVERAGE:%4.2lf Avg,"
"GPRINT:m_max:MAX:%4.2lf Max,"
"GPRINT:m_avg:LAST:%4.2lf Last\n"
"AREA:l_avg#FF0000:15m average:STACK"
"GPRINT:l_min:MIN:%4.2lf Min,"
"GPRINT:l_avg:AVERAGE:%4.2lf Avg,"
"GPRINT:l_max:MAX:%4.2lf Max,"
"GPRINT:l_avg:LAST:%4.2lf Last\n"

on this page: https://manuelluis.github.io/jsrrdgraph/test/test1.html

manuelluis commented 9 years ago

Fixed in 1c43e45507935fbcc99f735b11b3be97da4da91f

clement-parisot commented 9 years ago

Thanks you ! It works perfectly :)