pie chart

A

alexjaquet

Hi,

I want to use use GD::Graph::pie; to generate some graph from db datas.
But I don't know how to work with the array for the graph

here a sample code I use to collect my db datas:

local our ($c)= sqlSelectMany("DISTINCT(id_recherche),
nom,ref_categorie,nbr","recherche,a_recherche"," ref_recherche =
id_recherche $where ORDER BY nbr DESC LIMIT 0,$nbr_show");
while( ($SEARCH{'nom'},$SEARCH'nbr'})=$c->fetchrow()) {
$array[ $i -1 ] = "$SEARCH{'nom'}";
$array[ $j -1 ] = "$SEARCH{'nbr'}";
}
How to put it into the data array used for the graph :

local our @data = (
[ qw( 1st 2nd 3th 4th 5th 6th 7th 8h 9th 10th) ],
[ sort { $b <=> $a} (5.6, 7.1, 3.03, 4.05, 1.34, 0.2, 2.56, 2.56,
2.56, 2.56) ]
);

local our $my_graph = new GD::Graph::pie( 300, 300 );
#more code not usefull for the question
$my_graph->plot(\@data);

Thanks
 
R

Richard Gration

Hi

I'd just like to recommend an alternative to GD graphs: ChartDirector
I've been using it for a while and I think it's fantastic. Unless you buy
a licence there is a nag bar at the bottom of all the graphs which may
make it unusable for you. We bought a licence quite happily, it's well
worth it :)

http://www.advsofteng.com/download.html

Rich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top