[rrd-developers] Re: PIE CHART ???

Keith Sinclair keith at sinclair.org.au
Thu Mar 7 03:41:17 MET 2002


Danny,

Attached is a sample file and here is the code, pretty straight forward.


Regards


Keith

---------------------------
my %tech_list = loadCSV($config{Technology_Table},$config{Technology_Key});
my @data;
my @d1;
my @d2;
my @d3;
my $i = 0;
my $max = 0;
foreach my $key ( sort (keys %tech_list) ) {
	if  ($tech_list{$key}{type} eq "Technology" ) {
		if ( $max < $tech_list{$key}{count} ) {
			$max = $tech_list{$key}{count};
		}
		$d1[$i] = "$tech_list{$key}{technology}";
		$d2[$i] = $tech_list{$key}{count};
		++$i;
	}
}
@data = ( [@d1], [@d2] );

my $graph = GD::Graph::pie3d->new(640, 480);
$graph->set(
	x_label           => 'Technology',
	y_label           => 'Node Count',
	#title             => 'Technology Profile',
	x_labels_vertical => 1,
	y_max_value       => $max,
	y_tick_number     => 8,
	y_label_skip      => 2
);
my $gd = $graph->plot(\@data);
open(IMG, ">$config{tech_image}") or die "ERROR with $config{tech_image}.
$!\n";
binmode IMG;
print IMG $gd->png;
close IMG;

> -----Original Message-----
> From: rrd-developers-bounce at list.ee.ethz.ch
> [mailto:rrd-developers-bounce at list.ee.ethz.ch]On Behalf Of Danny
> Bendersky
> Sent: Wednesday, March 06, 2002 5:21 AM
> To: keith at sinclair.org.au; Torleiv Ringer
> Cc: rrd-developers at list.ee.ethz.ch
> Subject: [rrd-developers] Re: PIE CHART ???
>
>
>
> That will be great! can you please send me that, and if you have some
> examples will be great too.
>
> Thanks!
>
>
> On 6/3/02 4:25 AM, "Keith Sinclair" <keith at sinclair.org.au> wrote:
>
> > You could do an RRD Fetch then use GD::Graph and GD::Graph3d to
> do the pie
> > chart.  I have some code handy if you like.
> >
> >
> > Regards
> >
> >
> > Keith
> >
>
>
> --
> Unsubscribe
mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi


-- Attached file removed by Listar and put at URL below --
-- Type: image/png
-- Size: 10k (10692 bytes)
-- URL : http://www.ee.ethz.ch/~slist/pantomime/tech.png


--
Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-developers mailing list