Forum OpenACS Q&A: Graphing for OACS?
i already used the TGDGraph it works but i need it to be dynamic and something that would works on ADP pages..
Why isn't it dynamic? I've used it to generate dynamic graphs, an example of which is shown in https://openacs.org/forums/message-view?message_id=44869, and I've used the generated graphs in the .adp.
Do you mean generating a graph without saving to a file? I think nsgd does that but IIRC you have to return _only_ the graph to the connection.
There is chartdir.tar.gz distribution of this C++ library for Linux as well for convenience.
before in my page i usually place.. <img src=graph.tcl> to produce the graph together with the other forms and text..
but since ill be querying different tables depending on the parent page.. i think <img src=graph.tcl> wouldnt do the trick... unless ill be able to pass an argument to graph.tcl in the adp page.. such as <img src=graph.tcl $tables_to_query > but i dont think its possible (or i might be wrong)..
i found somewhat a sol'n but caused another problem..
i tried to place the code of graph.tcl in page1.tcl and from it @foo@ can be accessed from page2.adp.. and outputs the binary using <img src=<%[ns_writebinary @foo@]%>> but another problem arises it only output the image it didn't include my html text and forms..
<img src=graph.tcl @argv1@ @argv2@>
set argv "dyanmicvalue1"
set argv "dynamicvalue2"
set data [ns_chartdir image $chart]
i got this line from one of your examples... is it possible to output the value of data which i think is the binary data of the chart from an adp page...
because im stuck in the same situation... just like in tgdchart i cant output the image from a variable.. when i used the ns_writebinary it only outputs the chart only. it didnt include text and form elements..
set argv1 "dynamicvalue1"
set argv2 "dynamicvalue2"
set graph_link "graph.tcl?[export_url_vars argv1 argv2]"
You can see very similar code in various OpenACS packages. For example, check out workflow-gif.tcl, case-state-graph.tcl, and case-state-graph.adp in packages/acs-workflow/www/