Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: teach me Chart::Pie

by kutsu (Priest)
on Feb 18, 2005 at 16:18 UTC ( [id://432382]=note: print w/replies, xml ) Need Help??


in reply to teach me Chart::Pie

"Teach Me" is a phrase I've found myself hearing quite often, and one I've come to loath. "Teach Me", I have found, usually means "I want to learn something with little effort on my part". Students who come with this attitude often become weights attach to the backs of other students, forcing you to spend extra time teaching and re-teaching a lesson when other students are ready to progress - then finding that the "Teach Me" student has moved on finding it still to much effort and sometimes a good student has been lost because of his lack of progress, lack of steady improvement.

This is less to say anything about the AM who posted this, being as I've never meet him, and more to do with the annoyance and wasted time such a phrase has cost me (both as teacher and student). I suggest that a better phrase, better attitude perhaps, would be "Help me to Learn".

As for the actually question: How about a snippet or some example code, showing the error?

"Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce

Replies are listed 'Best First'.
Re^2: teach me Chart::Pie
by Anonymous Monk on Feb 18, 2005 at 16:35 UTC
    Sorry for your time or anyone else. The code is the same as on CPAN.org. I just copied it, that why I didn't understand how it work. It seem the code create a .gif file. I do think they should tell how to use the code, as I can't understand the code by just looking at it.
    use Chart::Pie; my $chart = Chart::Pie->new(640,480); $chart->set( 'title' => 'A Day in the Life', 'x_label' => 'X Axis Label', 'y_label' => 'Y Axis Label' , 'label_values' => 'percent', # tell me percentage of # each day spent on # each activity 'x_ticks' => 'none', 'y_ticks' => 'none', ); $chart->add_dataset( qw(Junk_X_Tick_Label) ); $chart->add_dataset( qw(8) ); $chart->add_dataset( qw(8) ); $chart->add_dataset( qw(2) ); $chart->add_dataset( qw(6) ); $chart->set('legend_labels' => [ 'Sleep', 'Work', 'Eat', 'Watch TV' + ]); $chart->gif('pie.gif');
      $chart->gif('pie.gif');
      If you RTFM of the module you are using, and the modules it uses, you'll see that this code makes a file. Nothing in there (nor in the module developer's head!) says that this module will be used to generate a web page. Your webserver is loading file 'index.html' (or whatever). If you had told the webserver to load 'pie.gif', it would have done so and you would have gotten what you expected.

      Let me say that I ++ you because you kept on trying after asking your question here. Perl by itself is a BIG subject and tossing in UN!X, Apache, and the Web as well makes it truly complex, and we all get bitten by the multiple levels of interaction once in a while. (At least, I know I do!). You will be much rewarded as a coder if you take the time and patience to think through what's happening when you don't get what you expect. :D

      In this script, $chart is a Chart::Pie object and not the pie chart you want to display. The pie chart is output as pie.gif. In order to display the gif you will need to learn how to write CGI scripts. Ovid has a nice online CGI Course and there is a wealth of information on the subject here at PerlMonks.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://432382]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-25 10:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found