How to make each bar clickable in a graph in perl

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.


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.

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.

Category:perl Time:2012-04-17 Views:0

Related post

  • How do I make the whole area of a list item in my navigation bar, clickable as a link? 2010-06-19

    I've got a horizontal navigation bar made from an unordered list, and each list item has a lot of padding to make it look nice, but the only area that works as a link is the text itself. How can I enable the user to click anywhere in the list item to

  • Multiple Bar plot in one graphs in R 2011-02-23

    I'm a beginner to R. I need to create a graph like I dont know how to produce my entire dataset. The basic idea is some exon id would have more than one subgroups. I need to plot all the values in bar plots within that exon id How can I do that in R?

  • Only bars in a JfreeChart graph 2012-01-13

    This might sound silly, but I'd only want to display bars in a JfreeChart and a transparent background. All examples show how to create a PNG with transparent background but this is not what I want, I just want to display it, no need to create it. Be

  • Bar images issue on graph using GD libraray 2012-03-14

    I just want to know how to display bars with exact data array value on my graph using Gd library functions with for loop / for-each loop kindly reply me helps are definitely appreciated Confusion comment tag in this code is indicate my problem $array

  • How to move the bars in a Column graph 2013-10-26

    I have Home and Student 2007 How do you move specific bars in the graph. (I know how to move all of them closer and farther, but I can't figure out how to move specific ones.) --------------Solutions------------- Where do you want to move them to? Ar

  • How do i make each bar in an excel graph automatically change colors based on the data? 2014-07-19

    I want my excel bar graph colors to change based on the cell data. For example cell A1 in my graph may be over goal. If that is the case I want the bar graph representing that cell to be the color red. --------------Solutions------------- Where did y

  • Dynamically sizing bar charts with google graph 2011-08-28

    This is just a quick one but I cant find what i need to figure this out. any helps is appreciated. In the google graphs playground about halfway down (line 48 i think) there is a width variable. It seems to be set as a pixel by default. Is there any

  • Enable list item to clickable area in jQuery Mobile 2011-11-08

    Description: Following code piece is used in Android/iPhone for Roundabout carousal. Each LI is 100px x 100px in width and height. And link is top of the LI. <div data-role="content" data-theme="aa"> <ul class="roundabout-holder"> <li

  • How do you plot bar charts in gnuplot? 2008-11-29

    How do you plot bar charts in gnuplot with text labels? --------------Solutions------------- Simple bar graph: set boxwidth 0.5 set style fill solid plot "data.dat" using 1:3:xtic(2) with boxes data.dat: 0 label 100 1 label2 450 2 "bar label" 75 If y

  • Creating colored bars for poll results 2009-05-28

    In my web app I'd like to display poll results with colored bars with length proportional to the percentage of votes. How can I achieve this with HTML/CSS? --------------Solutions------------- This site contains some nice examples: http://apples-to-o

  • Bar chart in Javascript: stacked bars + grouped bars 2011-02-18

    I'm looking for a Javascript solution to mix Grouped and Stacked Bars with a beautiful graph, such as those provided by Protovis. For example if I want to compare downloads on Apple (iPads+iPhones) devices to Android devices, I might have (excuse my

  • Gnuplot horizontal bars on every tic 2011-04-02

    In gnuplot, how can i draw horizontal bars across the entire graph at every tic mark on the y axis? Just as a sort of visual indicator of where a specific point is. (apologies if this is simple, but googling was fruitless) --------------Solutions----

  • how do i remove the bar chart when the view disappeared in iphone? 2011-05-26

    I am new to core plot. I had drawn a bar chart using core plot. I want to remove the bar chart which I drawn using core plot once the view disappeared and draw once again with the new values when the view appears. Can anyone suggest me a solution to

  • Issue relate to sencha touch bar charts 2011-12-23

    I am very new to sencha touch. Working with sencha touch to develop bar charts. I am an issue regarding the bar width of the chart. As the number of bars get increased the bar width gets decreased. But the thing is it should not happen like that. The

  • Alignment of numbers on the individual bars with ggplot2 2012-02-07

    I want to show numbers on the individuals bars in the following graph. df <- structure(list(A = structure(c(1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L), .Label = c("0-50,000", "50,001-250,000", "250,001-Over"), class = "factor"), B = structure(c(1L, 2L, 3

  • In Perl, is there any scenario in which ${foo[bar]} could be syntactically valid code? 2012-03-12

    I am reading through O'Reilly's Programming Perl, 3rd Edition, and the text states that instead of using the ambiguous search pattern /$foo[bar]/, one should instead use /${foo[bar]}/ so that Perl doesn't mistake [bar] for a character class. Am I mis

  • No Error bar option in “Format Data Point” window when bars are double-clicked. 2012-12-01

    MS Excel 2008 for Mac (Version 12.3.2): No Error bar option in “Format Data Point” window when bars are double-clicked. --------------Solutions------------- Only certain chart types support error bars. Use a bar, column, or line chart. Is this a ques

  • EXCEL 2010 - Bar or Column Chart - Using a Single Cell Outside the Data Poinst To Set the Colour 2013-05-15

    Hi Everyone, I want to use a cell, lets say A1, and store the RBG colour to be used on charts located on the same worksheet: A B C D E 1 0,0,0 2 3 4 5 Then the chart bars would all be black... The reason is so that I can just update one area on the s

  • Adding error bars at once for multiple series (in a line graph) 2013-08-02

    When adding error bars to a line graph, Excel requires me to add the error bar for each series one by one. This is useful when you have few series and a lot of data points, but I have the reverse: a lot of series and few data points. So I want to be

Copyright (C), All Rights Reserved.

processed in 2.595 (s). 13 q(s)