Page 1 of 1

JPGraph : inversion of values between bar graph and pie gaph

Posted: 15 Feb 2006, 16:01
by troul
Hi,

When I look the summaries of bugs I can see that bar graphs are correct but the pie graph are wrong :
on this example :
Image

you can see that I should have :
- about half "new" --> orange
- about half "closed"
- only one "assigned" --> blue-green

It appears that the x values of the bargraph don't match with the order of the pie-graph, it's just the opposite, like two arrays read once from the top and once from the bottom.

Any solution ?

I use jpgraph-1.20.2 and mantis-0.19.4

Antoine

Here's the solution

Posted: 17 Feb 2006, 11:49
by seba
I solve it this way:
open the file:
core/graph_api.php:

Find the following line (line 239 in Mantis 1.0.0rc1):

$p1 = new PiePlot3d( array_values( $p_metrics ) );

And replace it with:

$p1 = new PiePlot3d( array_reverse( array_values( $p_metrics ) ) );


Now the pie chart and it's references should look right

Here's the solution

Posted: 17 Feb 2006, 11:50
by seba
I solve it this way:
open the file:
core/graph_api.php:

Find the following line (line 239 in Mantis 1.0.0rc1):

$p1 = new PiePlot3d( array_values( $p_metrics ) );

And replace it with:

$p1 = new PiePlot3d( array_reverse( array_values( $p_metrics ) ) );


Now the pie chart and it's references should look right

Posted: 20 Feb 2006, 22:10
by thraxisp
The bug is in the jpgraph library. With v2.1.1, this code works without changes.