Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] perl Chart::Graph module

Expand Messages
  • Nick Keeling
    We have some programs where we use the graphs. The trick is to just keep playing with all of the settings until we achieved the look that we wanted. Here is a
    Message 1 of 4 , Jan 3, 2005
    • 0 Attachment
      We have some programs where we use the graphs. The trick is to just keep playing with all of the settings until we achieved the look that we wanted.

      Here is a basic example:

      #!/usr/bin/perl
      use GD::Graph::mixed;

      #=== create graph ===#
      @month = ('Jan','Feb','Mar');
      @ans_pct=('78','84','82');
      @goal=('80','80',80');

      @data = ([(@month)],[(@ans_pct)],[(@goal)]);

      $graph = GD::Graph::mixed->new(700, 300);

      $graph->set(
      title => "Percentage of Calls Answered",
      y_label => '% Answered',
      y_max_value => 100,
      y_tick_number => 10,
      y_label_skip => 1,
      y_long_ticks => 1,
      tick_length => -1,
      bar_spacing => 3,
      legend_placement=> 'RC',
      y_number_format => '%d%%',
      dclrs => [ ('red', 'black') ],
      types => [ "bars", "lines" ],
      ) or warn $my_graph->error;

      $graph->set_legend("Calls Answered Pct.","Goal");

      my $gd = $graph->plot(\@data) or warn $graph->error;

      $rand = rand(1000);

      $file = "perl_test$rand\.png";
      open(IMG, ">/var/www/html/acd/graphs/$file") or warn $!;
      binmode IMG;
      print IMG $gd->png;
      close(IMG);

      Any questions, let me know.

      Nick Keeling
      nickjk@...
      NOC Support Engineer
      SRT Communications, Inc.


      >>> for_kinjal@... 12/30/04 12:54PM >>>


      If anyone has used the perl Chart::Graph module, I am looking for few
      examples on how to use this module, basically I want to read data
      from a file and create graph based on the data.
      Thanks






      Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
      Yahoo! Groups Links











      [Non-text portions of this message have been removed]
    • for_kinjal
      Thanks Nick, I am not able use the perl GD::Graph package and looking some similar example for the perl Chart::Graph module. ... just keep playing with all of
      Message 2 of 4 , Jan 11, 2005
      • 0 Attachment
        Thanks Nick, I am not able use the perl GD::Graph package and
        looking some similar example for the perl Chart::Graph module.

        --- In perl-beginner@yahoogroups.com, "Nick Keeling" <nickjk@s...>
        wrote:
        > We have some programs where we use the graphs. The trick is to
        just keep playing with all of the settings until we achieved the
        look that we wanted.
        >
        > Here is a basic example:
        >
        > #!/usr/bin/perl
        > use GD::Graph::mixed;
        >
        > #=== create graph ===#
        > @month = ('Jan','Feb','Mar');
        > @ans_pct=('78','84','82');
        > @goal=('80','80',80');
        >
        > @data = ([(@month)],[(@ans_pct)],[(@goal)]);
        >
        > $graph = GD::Graph::mixed->new(700, 300);
        >
        > $graph->set(
        > title => "Percentage of Calls Answered",
        > y_label => '% Answered',
        > y_max_value => 100,
        > y_tick_number => 10,
        > y_label_skip => 1,
        > y_long_ticks => 1,
        > tick_length => -1,
        > bar_spacing => 3,
        > legend_placement=> 'RC',
        > y_number_format => '%d%%',
        > dclrs => [ ('red', 'black') ],
        > types => [ "bars", "lines" ],
        > ) or warn $my_graph->error;
        >
        > $graph->set_legend("Calls Answered Pct.","Goal");
        >
        > my $gd = $graph->plot(\@data) or warn $graph->error;
        >
        > $rand = rand(1000);
        >
        > $file = "perl_test$rand\.png";
        > open(IMG, ">/var/www/html/acd/graphs/$file") or warn $!;
        > binmode IMG;
        > print IMG $gd->png;
        > close(IMG);
        >
        > Any questions, let me know.
        >
        > Nick Keeling
        > nickjk@s...
        > NOC Support Engineer
        > SRT Communications, Inc.
        >
        >
        > >>> for_kinjal@y... 12/30/04 12:54PM >>>
        >
        >
        > If anyone has used the perl Chart::Graph module, I am looking for
        few
        > examples on how to use this module, basically I want to read data
        > from a file and create graph based on the data.
        > Thanks
        >
        >
        >
        >
        >
        >
        > Unsubscribing info is here:
        http://help.yahoo.com/help/us/groups/groups-32.html
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        > [Non-text portions of this message have been removed]
      • Fraser Baker
        I attempted to use GD. Actually, I attempted to install it on a Windows box, and couldn t. Found a charting package called ChartDirector, which is very
        Message 3 of 4 , Jan 11, 2005
        • 0 Attachment
          I attempted to use GD. Actually, I attempted to install it on a Windows box,
          and couldn't. Found a charting package called ChartDirector, which is very
          powerful, friendly and easy to install on my Windows box. Tech support is
          awsome. Costs $99.

          Fraser
          -----Original Message-----
          From: for_kinjal [mailto:for_kinjal@...]
          Sent: Tuesday, January 11, 2005 4:38 PM
          To: perl-beginner@yahoogroups.com
          Subject: Re: [PBML] perl Chart::Graph module



          Thanks Nick, I am not able use the perl GD::Graph package and
          looking some similar example for the perl Chart::Graph module.

          --- In perl-beginner@yahoogroups.com, "Nick Keeling" <nickjk@s...>
          wrote:
          > We have some programs where we use the graphs. The trick is to
          just keep playing with all of the settings until we achieved the
          look that we wanted.
          >
          > Here is a basic example:
          >
          > #!/usr/bin/perl
          > use GD::Graph::mixed;
          >
          > #=== create graph ===#
          > @month = ('Jan','Feb','Mar');
          > @ans_pct=('78','84','82');
          > @goal=('80','80',80');
          >
          > @data = ([(@month)],[(@ans_pct)],[(@goal)]);
          >
          > $graph = GD::Graph::mixed->new(700, 300);
          >
          > $graph->set(
          > title => "Percentage of Calls Answered",
          > y_label => '% Answered',
          > y_max_value => 100,
          > y_tick_number => 10,
          > y_label_skip => 1,
          > y_long_ticks => 1,
          > tick_length => -1,
          > bar_spacing => 3,
          > legend_placement=> 'RC',
          > y_number_format => '%d%%',
          > dclrs => [ ('red', 'black') ],
          > types => [ "bars", "lines" ],
          > ) or warn $my_graph->error;
          >
          > $graph->set_legend("Calls Answered Pct.","Goal");
          >
          > my $gd = $graph->plot(\@data) or warn $graph->error;
          >
          > $rand = rand(1000);
          >
          > $file = "perl_test$rand\.png";
          > open(IMG, ">/var/www/html/acd/graphs/$file") or warn $!;
          > binmode IMG;
          > print IMG $gd->png;
          > close(IMG);
          >
          > Any questions, let me know.
          >
          > Nick Keeling
          > nickjk@s...
          > NOC Support Engineer
          > SRT Communications, Inc.
          >
          >
          > >>> for_kinjal@y... 12/30/04 12:54PM >>>
          >
          >
          > If anyone has used the perl Chart::Graph module, I am looking for
          few
          > examples on how to use this module, basically I want to read data
          > from a file and create graph based on the data.
          > Thanks
          >
          >
          >
          >
          >
          >
          > Unsubscribing info is here:
          http://help.yahoo.com/help/us/groups/groups-32.html
          > Yahoo! Groups Links
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          > [Non-text portions of this message have been removed]





          Unsubscribing info is here:
          http://help.yahoo.com/help/us/groups/groups-32.html



          ----------------------------------------------------------------------------
          --
          Yahoo! Groups Links

          a.. To visit your group on the web, go to:
          http://groups.yahoo.com/group/perl-beginner/

          b.. To unsubscribe from this group, send an email to:
          perl-beginner-unsubscribe@yahoogroups.com

          c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



          [Non-text portions of this message have been removed]
        • daymobrew@yahoo.com
          ... You could look into: SWF::Chart. http://www.oreillynet.com/pub/wlg/5665 It is a port of a PHP module to display charts using Macromedia Flash. You have to
          Message 4 of 4 , Jan 12, 2005
          • 0 Attachment
            --- In perl-beginner@yahoogroups.com, "for_kinjal" <for_kinjal@y...>
            wrote:
            >
            > Thanks Nick, I am not able use the perl GD::Graph package and
            > looking some similar example for the perl Chart::Graph module.
            >
            > --- In perl-beginner@yahoogroups.com, "Nick Keeling" <nickjk@s...>
            > wrote:
            > > We have some programs where we use the graphs. The trick is to
            > just keep playing with all of the settings until we achieved the
            > look that we wanted.
            > >
            > > Here is a basic example:
            > >
            > > #!/usr/bin/perl
            > > use GD::Graph::mixed;
            > >
            > > #=== create graph ===#
            > > @month = ('Jan','Feb','Mar');
            > > @ans_pct=('78','84','82');
            > > @goal=('80','80',80');
            > >
            > > @data = ([(@month)],[(@ans_pct)],[(@goal)]);
            > >
            > > $graph = GD::Graph::mixed->new(700, 300);
            > >
            > > $graph->set(
            > > title => "Percentage of Calls Answered",
            > > y_label => '% Answered',
            > > y_max_value => 100,
            > > y_tick_number => 10,
            > > y_label_skip => 1,
            > > y_long_ticks => 1,
            > > tick_length => -1,
            > > bar_spacing => 3,
            > > legend_placement=> 'RC',
            > > y_number_format => '%d%%',
            > > dclrs => [ ('red', 'black') ],
            > > types => [ "bars", "lines" ],
            > > ) or warn $my_graph->error;
            > >
            > > $graph->set_legend("Calls Answered Pct.","Goal");
            > >
            > > my $gd = $graph->plot(\@data) or warn $graph->error;
            > >
            > > $rand = rand(1000);
            > >
            > > $file = "perl_test$rand\.png";
            > > open(IMG, ">/var/www/html/acd/graphs/$file") or warn $!;
            > > binmode IMG;
            > > print IMG $gd->png;
            > > close(IMG);
            > >
            > > Any questions, let me know.
            > >
            > > Nick Keeling
            > > nickjk@s...
            > > NOC Support Engineer
            > > SRT Communications, Inc.
            > >
            > >
            > > >>> for_kinjal@y... 12/30/04 12:54PM >>>
            > >
            > >
            > > If anyone has used the perl Chart::Graph module, I am looking for
            > few
            > > examples on how to use this module, basically I want to read data
            > > from a file and create graph based on the data.
            > > Thanks
            > >

            You could look into: SWF::Chart.
            http://www.oreillynet.com/pub/wlg/5665
            It is a port of a PHP module to display charts using Macromedia Flash.
            You have to download the Flash file, chart.swf, from
            http://www.maani.us/charts. There is a tutorial at that site.

            I haven't tried it yet but it looks good.
          Your message has been successfully submitted and would be delivered to recipients shortly.