Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

GD::Graph New Window

by Mitch (Sexton)
on Jul 21, 2003 at 22:08 UTC ( [id://276511]=perlquestion: print w/replies, xml ) Need Help??

Mitch has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

Perl: ActiveState 5.6.1, OS Windows 2000, IIS 5.0

I'm having troulble outputting a chart to a new window. If I call the below sample code from a form or an image tag within the same window the pie image is successfully returned to the browser. However, if I call the code with javascript's,
window.open("pie.pl?$passstring", "window name", "width=650,height=650 +")
the output prompts me to open or save the file. I guess it doesn't know where to return the output. Any ideas on how I can tell it to output to the current window or why it's trying to output as a file?
use GD::Graph::pie(350,350); @data=([@name], [@value]); $graph = new GD::Graph::pie; $graph->set( title => "$title", label => 'Label Goes Here', axislabelclr => 'black', '3d' => 1, start_angle => 90, suppress_angle => 5) or warn $graph->error; $graph->set_title_font(GD::Font->MediumBold); $graph->set_value_font(GD::Font->Small); $format=$graph->export_format; print header("image/$format"); binmode STDOUT; print $graph->plot(\@data)->$format() or die $graph->error;

Thanks.

Mitch

Replies are listed 'Best First'.
Re: GD::Graph New Window
by AcidHawk (Vicar) on Jul 22, 2003 at 07:01 UTC

    I am confused. You start by saying that you are having trouble outputting the chart to a new window but then later say that you are trying to output to the current window

    If I look at you javascript I believe that this will open a new browser window. So if this is what you are tryin to do ... have you tried ...html (anchor tag) code follows

    <A TARGET="_blank" HREF=""pie.pl?$passstring"">Display Pie Chart</A>
    This will open the output of your pie.pl script in a NEW window..

    -----
    Of all the things I've lost in my life, its my mind I miss the most.
      The problem is if I call the pl with the open window function it doesn't work. It only works if a pl is called with an image tag to display in the already open window. I think it might be a matter of using a "Get". I'm going to try opening a window containing a form with hidden fields and auto submit. This way the pl will be called with a "Post" instead.

      Mitch

Log In?
Username:
Password:

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

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

    No recent polls found