1

I've generated a dynamic graph based off of the data from my MySQL db, and now I'm looking to see if there is a way that GD or one of its packages allows you to add the values of what each bar is above that bar. Basically the data is very specific, numbers like 3.45, 1.23, 10.1, etc... and it would be best if the user viewing the graph could both view its value generally, and exactly.

So has anybody done this? Also let me know if more information is needed.

Thanks! :)

[Edit]: Using GD::Graph::bars only right now.

Not sure what parts of my code to show but here are my arrays that pull the data from my DB to show on the graph. All of the GD::Graphic coding or HTML coding I use is standard:

while (my @results = $sth->fetchrow_array) {
    push @res_sample, $results[1];
    push @res_value, $results[0];
}
my @data = (
    [@res_sample],
    [@res_value],
);
byobob
  • 99
  • 1
  • 13
  • 1
    Could you show us your code? Are you using [GD::Graph](https://metacpan.org/module/GD::Graph) or just plain GD as your base? – Demnogonis Aug 01 '13 at 14:44
  • GD is a graphics library, not a graphing library. The two are very different functions. – PP. Aug 01 '13 at 15:11
  • ok I edited my original post, please take a look – byobob Aug 01 '13 at 15:27
  • I'm afraid that this snippet is not very useful, since you have problems with the graphing part. Can you please provide more code? – Demnogonis Aug 01 '13 at 17:25
  • I have a lot of code, should I provide the HTML parts, the SQL codes or the GD::Graph codes? – byobob Aug 01 '13 at 17:42
  • The parts you have trouble with :o) In context of your question the GD::Graph part. – Demnogonis Aug 01 '13 at 17:43
  • Ok thanks anyway. Maybe the question wasn't clear. I had thought it would be a very simple GD::Graph code line and it was, I found 'show_values => 1,', simple as that. That's why I was being reluctant to show my code. Thanks anyway :) – byobob Aug 01 '13 at 19:43

0 Answers0