graph

hi,
i would like to know how can i generate a bar chart automatical using perl.
i've tried using Text::Graph module but the output is not really a bar chart.
and i've also tried Template::Plugin::GD::Graph::bars  however i do not know how to apply with perl.

does anyone know any other method to generate bar chart with perl?
OR
any other simpler method

Sample codes provided will be much appreciated

ps. the bar chart generated must have x & y axis. i am using debian linux 3.0 and perl 5.6.1

thanks
TPolyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

windfallCommented:
Here's an example of how we have done a chart using GD

Using Activestate and windows server....

Hope this helps..
#########################
#c:\perl\bin\perl
#call to escape unescape funny characters
use CGI qw/escape unescape/;
$sample_label = "Sample_CHART";
use GD;
use Chart::Bars;

#create an instance of CGI
$query = new CGI;

@hours = ();#make an array of titles for the "x" axis
# To make a "time of day chart"
#e.g. this will give an array of hours for the "x" axis - midnite => 23:00
foreach $i(0..23){
push (@hours, "$i:00");
}


#make some arrays of values for the various bars of the chart -y
#could be read in from a database table etc
#example:
@records = ('21','32','76','33','13','23','87','67','56','45','23','34','21','23','32','34','32','23','34','34','76','21','2','33');#Number of requests per hour

@ave_min = ('15','32','12','23','2','5','9','10','34','21','23','54','67','67','78','5','23','0','32','45','7','56','44','3'); # deltas divided by conults


#Now make an associated array to build the image

@daily = ([@hours], [@records], [@ave_min]);

@labels = ("\# of entries for the hour","Average \# of minutes to room");# explanatory note for legend
# Makes the chart
$obj = Chart::Bars->new (600,400);# Set the size of the image
 $obj->set ('title' => "Values for Sample Chart");# Place the title of the chart
 $obj->set ('x_label' => 'Hours');# Label the x axis
 $obj->set ('y_label' => 'Label Up the Side!!');# Label the y axis
 $obj->set ('legend' => 'bottom');# places the legend on the bottom
 $obj->set ('legend_labels' => \@labels);# describes the various colors of bars in the legend
 #$obj->set ('skip_x_ticks' => '2');# Skips over some of the x axis labels for viewing clarity
 $obj->set ('x_ticks' => 'vertical');#x axis labels for viewing clarity up and down
 $obj->set ('grid_lines' => 'true');# Places grid lines on the chart
 
 $obj->png (">D:/resource/www/images/pngchart/$sample_label.gif", \@daily );
 $obj->clear_data ();
 #$obj->set ('no_cache' => 'true');
 #$obj->cgi_png ( \@daily );

#create an instance of CGI
$query = new CGI;

print $query->header("-nph=>1");
print $query->start_html(-title => 'CHART');

print <<HTML;

<img src=/images/pngchart/$sample_label.gif>

<!--End Content here -->

HTML

print $query->end_html;


###############
Hope this helps
Windfall
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TPolyAuthor Commented:
hi..
thanks for ur help..
jus want to know does this program able to generate the chart
in excel presenation chart format.

OR

do anyone know of any perl program/module that can do so.

thanks
0
windfallCommented:
Here's a link that has some examples using Perl and Excel

Maybe this will help...

Windfall

http://www.xav.com/perl/faq/Windows/ActivePerl-Winfaq12.html
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.