I am writting a Perl script to create pie graph using GD::Graph::pie with these arrays:
@Array1 = ("A", "B", "C", "D");
$array2 = [
['upto 100 values'],
['upto 100 values'],
['upto 100 values'],
['upto 100 values']
];
As per my understanding to get this done, I have to create an array with the references of above arrays, like:
my @graph_data = (\@Array1, @$array2);
I have also tried to use foreach
loop but not getting good results. I want to create pie graph with first value in @Array1
against first value in $array2
and second value in @Array1
against second value in $array2
and so on. Also I want put the same title for each graph as per values in @Array1
.
eg.
my @graph_data1 = (\@Array1[0], @$array2[0]);
Can anyone please suggest me the better way to do this?