summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 80d2388)
raw | patch | inline | side by side (parent: 80d2388)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 4 Aug 2005 04:58:11 +0000 (04:58 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 4 Aug 2005 04:58:11 +0000 (04:58 +0000) |
program/src/rrd_graph.c | patch | blob | history |
index bb31289e3df9a07415c97d090fe1d5cb9be870f6..2a13cb54e8ed62bf461b1914b3be57d31fcad833 100644 (file)
--- a/program/src/rrd_graph.c
+++ b/program/src/rrd_graph.c
if (im->gdes[i].col != 0x0){
/* GF_LINE and friend */
if(stack_gf == GF_LINE ){
+ double last_y=0;
node = NULL;
- for(ii=1;ii<im->xsize;ii++){
+ for(ii=1;ii<im->xsize;ii++){
if (isnan(im->gdes[i].p_data[ii]) || (im->slopemode==1 && isnan(im->gdes[i].p_data[ii-1]))){
node = NULL;
continue;
}
if ( node == NULL ) {
+ last_y = ytr(im,im->gdes[i].p_data[ii]);
if ( im->slopemode == 0 ){
node = gfx_new_line(im->canvas,
- ii-1+im->xorigin,ytr(im,im->gdes[i].p_data[ii]),
- ii+im->xorigin,ytr(im,im->gdes[i].p_data[ii]),
+ ii-1+im->xorigin,last_y,
+ ii+im->xorigin,last_y,
im->gdes[i].linewidth,
im->gdes[i].col);
} else {
node = gfx_new_line(im->canvas,
ii-1+im->xorigin,ytr(im,im->gdes[i].p_data[ii-1]),
- ii+im->xorigin,ytr(im,im->gdes[i].p_data[ii]),
+ ii+im->xorigin,last_y,
im->gdes[i].linewidth,
im->gdes[i].col);
}
} else {
- if ( im->slopemode==0 ){
- gfx_add_point(node,ii-1+im->xorigin,ytr(im,im->gdes[i].p_data[ii]));
+ double new_y = ytr(im,im->gdes[i].p_data[ii]);
+ if ( im->slopemode==0 && new_y != last_y){
+ gfx_add_point(node,ii-1+im->xorigin,new_y);
+ last_y = new_y;
};
- gfx_add_point(node,ii+im->xorigin,ytr(im,im->gdes[i].p_data[ii]));
+ gfx_add_point(node,ii+im->xorigin,new_y);
};
}