[comp.windows.x] Anyone got a graph widget

gnb@bby.oz.au (Gregory N. Bond) (03/26/91)

Yet another FAQ, without a doubt.

Does anyone have a graph widget that will do multiple line and/or bar
graphs on the one surface?  I am looking for fairly basic
business-type graphics.

I have seen graph.tar.Z from trix.ai.mit.edu (as named in the X FAQ
list).  It seems OK, but only one line graph at a time, and no bar
graphs (from what I can tell; there is no documentation...)

What would be ideal is the ability to have a hierarchy of widgets,
with a container widget that is the graph, does the scaling etc and
there is one child for each dataset on the graph.  This would allow
setting line colors/styles  etc as resources without imposing fixed
limits on the numbr of data items (I think...).

Greg.
--
Gregory Bond, Burdett Buckeridge & Young Ltd, Melbourne, Australia
Internet: gnb@melba.bby.oz.au    non-MX: gnb%melba.bby.oz@uunet.uu.net
Uucp: {uunet,pyramid,ubc-cs,ukc,mcvax,prlb2,nttlab...}!munnari!melba.bby.oz!gnb

sundar@ai.mit.edu (Sundar Narasimhan) (03/27/91)

In article <1991Mar26.073847.26457@melba.bby.oz.au>, gnb@bby.oz.au (Gregory N. Bond) writes:
|> Yet another FAQ, without a doubt.
|> 
|> Does anyone have a graph widget that will do multiple line and/or bar
|> graphs on the one surface?  I am looking for fairly basic
|> business-type graphics.
|> 
|> I have seen graph.tar.Z from trix.ai.mit.edu (as named in the X FAQ
|> list).  It seems OK, but only one line graph at a time, and no bar
|> graphs (from what I can tell; there is no documentation...)
Geez. I didn't know this was on the FAQ list. 
Anyways, to answer your questions: graph.tar.Z on trix.ai.mit.edu
has been updated. It DOES do many line graphs at a time and always
did (i.e. you can call graph_add(), graph_add_array() etc.. multiple times).

It also has a rudimentary histogramming capability. (try setting
*graph*histogram: true -- Ok. It doesn't use flashy tiles -- it just
draws rectangles). 

I also included a doc/doc.tex file which is a version of the documentation
that still hasn't quite caught up to the code. :-)

New resources that aren't documented: 
	*markpoints: Bool (says if points should be highlighted)
	*pointstyle: String (one of square, hatch, box)
	*histogram: Bool 
As usual, send bug reports/suggestions/enhancements etc. to me.

cjmchale@cs.tcd.ie (Ciaran McHale) (03/27/91)

In <1991Mar26.073847.26457@melba.bby.oz.au>
gnb@bby.oz.au (Gregory N. Bond) writes:

>[asks for a graph widget]
>What would be ideal is the ability to have a hierarchy of widgets,
>with a container widget that is the graph, does the scaling etc and
>there is one child for each dataset on the graph.  This would allow
>setting line colors/styles  etc as resources without imposing fixed
>limits on the numbr of data items (I think...).

Your suggestion is valid but to me sounds like you're confusing
requirements with implementation details. Another implementation
approach would be to use an OO graphics library (such as the one in
InterViews) and extend it to have a bar_chart_graphic, pie_chart_graphic
etc (each of which is a subclass of, say, graph_graphic). Using this
approach, each graph would be a graphic rather than a widget (window).
The advantage is that it would be easy to overlay several graphs. (If
each graph were a separate widow/widget then overlay one on another
would obscure the lower one.)


Ciaran.
-- 
Ciaran McHale		"Verbosity says it all"			      ____
Department of Computer Science, Trinity College, Dublin 2, Ireland.   \  /
Telephone: +353-1-772941 ext 1538	FAX: +353-1-772204	       \/
Telex: 93782 TCD EI			email: cjmchale@cs.tcd.ie

meo@Dixie.Com (Miles ONeal) (03/29/91)

If nobody sends one, and you need it now, you could
hack the scrollbar, or even the label widget to do
bar graphs.

sgombosi@isis.cs.du.edu (Stephen O. Gombosi) (03/30/91)

I'm looking for the same thing - simple, nitwit-level graphics (histograms,
(yuk) pie charts). I've looked at "graph" on trix and it doesn't seem to
fit the bill. Any help would be greatly appreciated!
THANKS!