Mike Slifcak <slif@bellsouth.net> many rrdtool-1.1.x fixes
Peter Speck <speck@vitality.dk> eps/svg/pdf file format code in rrdtool-1.x
David Grimes <dgrimes@navisite.com> SQRT/SORT/REV/SHIFT/TREND
+ Henrik Storner <henrik@hswn.dk> make rrd_graph() provide the min/max values of data in graph
Documentation
PREINIT:
char **calcpr=NULL;
int i,xsize,ysize;
+ double ymin,ymax;
char **argv;
AV *retar;
PPCODE:
}
optind=0; opterr=0;
rrd_clear_error();
- rrd_graph(items+1,argv,&calcpr,&xsize,&ysize,NULL);
+ rrd_graph(items+1,argv,&calcpr,&xsize,&ysize,NULL,&ymin,&ymax);
for (i=0; i < items; i++) {
free(argv[i+1]);
}
{
char **calcpr;
int xsize, ysize;
+ double ymin, ymax;
Tcl_Obj *listPtr;
char **argv2;
calcpr = NULL;
argv2 = getopt_init(argc, argv);
- if (rrd_graph(argc, argv2, &calcpr, &xsize, &ysize) != -1 ) {
+ if (rrd_graph(argc, argv2, &calcpr, &xsize, &ysize, NULL, &ymin, &ymax) != -1 ) {
listPtr = Tcl_GetObjResult(interp);
Tcl_ListObjAppendElement(interp, listPtr, Tcl_NewIntObj(xsize));
Tcl_ListObjAppendElement(interp, listPtr, Tcl_NewIntObj(ysize));
*****************************************************************************
* $Id$
* $Log$
+ * Revision 1.9 2005/02/13 16:13:33 oetiker
+ * let rrd_graph return the actual value range it picked ...
+ * -- Henrik Stoerner <henrik@hswn.dk>
+ *
* Revision 1.8 2004/05/26 22:11:12 oetiker
* reduce compiler warnings. Many small fixes. -- Mike Slifcak <slif@bellsouth.net>
*
/* main function blocks */
int rrd_create(int, char **);
int rrd_update(int, char **);
-int rrd_graph(int, char **, char ***, int *, int *, FILE *);
+int rrd_graph(int, char **, char ***, int *, int *, FILE *, double *, double *);
int rrd_fetch(int, char **, time_t *, time_t *, unsigned long *,
unsigned long *, char ***, rrd_value_t **);
int rrd_restore(int, char **);
char* drawgraph(long argc, char **args){
int i,xsize, ysize;
+ double ymin,ymax;
for(i=0;i<argc;i++)
if(strcmp(args[i],"--imginfo")==0 || strcmp(args[i],"-g")==0) break;
if(i==argc) {
optind=0; /* reset gnu getopt */
opterr=0; /* reset gnu getopt */
calfree();
- if( rrd_graph(argc+1, args-1, &calcpr, &xsize, &ysize,NULL) != -1 ) {
+ if( rrd_graph(argc+1, args-1, &calcpr, &xsize, &ysize,NULL,&ymin,&ymax) != -1 ) {
return stralloc(calcpr[0]);
} else {
if (rrd_test_error()) {
** - script parsing now in rrd_graph_script()
*/
int
-rrd_graph(int argc, char **argv, char ***prdata, int *xsize, int *ysize, FILE *stream)
+rrd_graph(int argc, char **argv, char ***prdata, int *xsize, int *ysize, FILE *stream, double *ymin, double *ymax)
{
image_desc_t im;
*xsize=im.ximg;
*ysize=im.yimg;
+ *ymin=im.minval;
+ *ymax=im.maxval;
if (im.imginfo) {
char *filename;
if (!(*prdata)) {
void pie_part(image_desc_t *, gfx_color_t, double, double, double, double, double);
int gdes_alloc(image_desc_t *);
int scan_for_col(char *, int, char *);
-int rrd_graph(int, char **, char ***, int *, int *, FILE *);
+int rrd_graph(int, char **, char ***, int *, int *, FILE *, double *, double *);
void rrd_graph_init(image_desc_t *);
void rrd_graph_options(int, char **, image_desc_t *);
void rrd_graph_script(int, char **, image_desc_t *, int);
const char *imgfile = argv[2]; /* rrd_graph changes argv pointer */
#endif
int xsize, ysize;
+ double ymin,ymax;
int i;
int tostdout = (strcmp(argv[2],"-") == 0);
- if( rrd_graph(argc-1, &argv[1], &calcpr, &xsize, &ysize, NULL) != -1 ) {
+ if( rrd_graph(argc-1, &argv[1], &calcpr, &xsize, &ysize, NULL, &ymin, &ymax) != -1 ) {
if (!tostdout)
printf ("%dx%d\n",xsize,ysize);
if (calcpr) {