Clickable Reports UI

From GnuCash
Jump to: navigation, search

Status: some information gathered, need input from someone more experienced :).

http://bugzilla.gnome.org/show_bug.cgi?id=359224

The graphical reports are nice, but they used to be clickable. It would be nice to make more stuff clickable again :)

The engine used for the graphs is "GnomeOffice Graph" (GOG for short, in libgoffice). It is mainly shared by Gnumeric and GnuCash, which both seem to keep copies of the tree in their own respective trees. So if changes need to be made there, we must make sure we submit them to upstream (wherever that is).

Handling piechart clicks is also done on the second page of the Graph "guru". Code for this can be found in goffice/graph/gog-guru.c, more specifically in the graph_guru_set_page and cb_canvas_select_item functions. This draws the piechart on a FooCanvas which supports button_press_event signals. GogPiePlot objects themselves don't support this signal, so we need to add the callback after rendering it to a pixmap.

The original goffice source code should be here: gog-guru.c and foo-canvas.h.

When I connect the button_press_event signal to the widget in addPixbufGraphWidget like this:

 g_signal_connect (G_OBJECT (widget),
                 "button_press_event",
                 G_CALLBACK (cb_graph_clicked), NULL);

I no longer get a "signal 'button_press_event' is invalid for instance" error at run-time, but the handler doesn't appear to be called either.

report/report-system/html-piechart.scm adds a piechart object to the report, gnome-utils/gnc-html-graph-gog.c binds the gnc-guppi-pie handler.