I have generated a graph. On click of each bar in the graph, I should be able to generate another graph. I am using GD::Graph module. If its not possible to make the bars clickable, is there a way where I can click the x-axis values at least? Thank you.
-
1What is the output? I thought GD-based modules are restricted to making files, and only files. – David Mertens Apr 18 '12 at 15:19
2 Answers
If you want user interaction, I believe you need to work with a GUI toolkit such as Prima (CPAN link), Gtk2 (CPAN link), or something else. (Note the Qt bindings are old and I am not sure they work these days.) For exampe, I don't think it would be too difficult to create an image file with GD::Graph and then load it into Prima. You'd have to write your own MouseDown routines, which might go beyond your skill or interest, but I think this is the only way (currently) to do it.

- 1,037
- 8
- 12
I agree with David, you need to make output which is clickable. If you are using a web interface then perhaps rather than generating an image via GD you need to create a Canvas plot using a javascript library. There are pleny to choose from. A quick search turned up highcharts for example.
If you are making a non-browser GUI then David has you covered.

- 20,180
- 5
- 49
- 104