Line Graphs and Reports

Michael T. Garrison Stuber
Sun, 17 Feb 2002 18:50:04 -0500 (EST)

> That's great news to hear. Yes, the need for a line graph had arised earlier, 
> but so far nobody made it to implement one.

I can see why.  The bar is pretty high.

> Kind of. I'd describe it this way (stable branch 1.6.x only): From the 
> viewpoint of the Scheme report code, the graphs are created through the 
> Scheme functions inside the files 
> src/scm/html-{barchart,piechart,scatter}.htm. Note that those commands don't 
> 'connect' anywhere, they only provide the proper HTML code for graph objects. 
> Upon setup of the gtkhtml widget in src/gnome/gnc-html-guppi.c , gnucash 
> registeres a special object type for guppi graphs in gtkhtml. 

Thanks.  The explanation really helps.  Maybe when I retrieve the few 
braincells I have left from the blender I'll write up an explanation for 
future developers.  Then again, maybe not . . .

> Since new code has to be written anyway, I'd strongly suggest using the Guppi 
> core API directly from Gnucash. This would basically mean that the code which 
> currently accesses the Guppi core API and lies in Guppi's directory 
> libguppitank/guppi-object-{barchart,pie,scatter}.c would the lie inside 
> Gnucash's src/gnome/gnc-html-guppi.c or similar. You should have a look at 
> those libguppitank files to see what needs to be done. Unfortunately I don't 
> find any examples on how line graphs are *used* within Guppi, but I know they 
> exist and are working now.

As you mentioned, it is a good idea to maintain some sort of wrapper layer
between GnuCash and Guppi.  At the same time, libguppitank already
provides this.  My inclination is to take the current libguppitank code
and rename it to avoid conflicts, and move it into the GnuCash branch, and
then modify it to support line plots, and whatever else in the core Guppi
API we want to add in the future.  It seems sort of silly to write an
abstraction layer from scratch, especially given I don't know the API well
enough to make intelligent decisions on what should be wrapped and what
should be exposed.  Thoughts on this?  Recommendations on names?  My 
inclination would be to create a guppi directory under the source tree, 
and to use "gnc-guppi" as a prefix for files and functions.   

Once I have this working, I could go back and migrate the existing 
graphing support inside of GnuCash to use modified libguppitank.  If the 
Guppi folks were planning on maintaining/expanding guppitank, I wouldn't 
bother, but it seems to be necessary.