JPGraph : inversion of values between bar graph and pie gaph

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
troul
Posts: 1
Joined: 15 Feb 2006, 15:49

JPGraph : inversion of values between bar graph and pie gaph

Post 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
seba

Here's the solution

Post 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
seba

Here's the solution

Post 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
thraxisp
Developer
Posts: 509
Joined: 14 Feb 2005, 03:38
Location: Ottawa, Canada
Contact:

Post by thraxisp »

The bug is in the jpgraph library. With v2.1.1, this code works without changes.
--
Glenn Henshaw Logical Outcome Ltd.
Mantis developer and user w: http://www.logicaloutcome.ca
Post Reply