Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > GD::Graph::Lines ... Controling some behavior...

Reply
Thread Tools

GD::Graph::Lines ... Controling some behavior...

 
 
TeraNews
Guest
Posts: n/a
 
      01-09-2004
I have a sample graph using GD::Graph::Lines, it's a simple X-Y line graph
(www.bitmosphere.com/cgi-bin/graph.pl) I want to change the color of the
graph border, and the tick lines (vertical and horiziontal). I can't seem
to find how to change them to: border being black, horiziontal lines being
light gray dashed, and vertical being light gray. Anyone know if this is
possible, or has done this?


Code:
#!/usr/bin/perl

use CGI::Carp qw(fatalsToBrowser);
use CGI ':standard';
use GD::Graph::lines;
use strict;

# Both the arrays should same number of entries.
my @data = (['v1', 'v2','v3','v4','v5'],
[30.5, 31, 31.04, 30.75, 33.01],
[29.5, 30.25, 30.25, 30.2, 30.75 ]);

my $mygraph = GD::Graph::lines->new(600, 300);
$mygraph->set(
x_label => 'X Axis',
y_label => 'Y Axis',
title => 'Chart Title',

y_tick_number => 5,
y_min_value => 29,
y_max_value => 34,
x_label_skip => 2,
long_ticks => 1,

# Draw datasets in 'solid', 'dashed' and 'dotted-dashed' lines
line_types => [1, 1],

# Set the thickness of line
line_width => 1,

# Set colors for datasets
dclrs => ['blue', 'red'],
) or warn $mygraph->error;


$mygraph->set_legend_font(GD::gdMediumBoldFont);
$mygraph->set_legend('Line Type 1', 'Line Type 2');

my $myimage = $mygraph->plot(\@data) or die $mygraph->error;

print "Context-type: image/png\n\n";
print $myimage->png;



Thanks,
Brian


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Reduce Security Risks on LAN by Controling wireless Noteboks Babak Majidi Wireless Networking 3 02-06-2006 10:24 AM
Controling panel visibility =?Utf-8?B?TWFydHlOWg==?= ASP .Net 0 05-26-2005 07:15 AM
Controling View Wireless Network Acess Points =?Utf-8?B?d2lnZ2xlYnJvdGhlcg==?= Wireless Networking 1 05-10-2005 04:55 PM
Controling cache expiration Kikoz ASP .Net 2 03-28-2005 08:33 PM
Controling a UserControl's hyperlink base McGiv ASP .Net 0 04-30-2004 03:00 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57