pChart 2.x forum
http://wiki.pchart.net/forum/

2dPie abilities
http://wiki.pchart.net/forum/viewtopic.php?f=3&t=381
Page 1 of 1

Author:  asba [ Tue Apr 05, 2011 1:32 pm ]
Post subject:  2dPie abilities

Hi,

I'm trying to display my array values inside a 2dpie ... which seems not to be possible when i look into pPie.class.php.
I've seen ability to display Labels around the pie but i still can't display values inside.

When i look in the documentation i see :

"You can write the data values setting WriteValues to TRUE or to PIE_VALUE_PERCENTAGE if you want to display the computed percentages."
and
"You can specify where the values will be written setting ValuePosition to : PIE_VALUE_INSIDE" OR "PIE_VALUE_OUTSIDE"

So i've tried :

$PieChart = new pPie($myPicture,$MyData);
$PieChart->draw2DPie(50,50,array("Radius"=>45,"Border"=>TRUE,"WriteValues"=>PIE_VALUE_PERCENTAGE,"ValuePosition"=>PIE_VALUE_INSIDE));

It would be kind if somebody can help me find what's wrong :)

Thanks

Author:  jean-damien [ Tue Apr 05, 2011 1:46 pm ]
Post subject:  Re: 2dPie abilities

Hi,

Something is missing in the documentation, you can set the WriteLabels parameters to :

- PIE_VALUE_NATURAL to have the value displayed.
- PIE_VALUE_PERCENTAGE to have the percentage.

I'll update the doc accordingly.

Kind regards,
JD.

Author:  asba [ Tue Apr 05, 2011 2:41 pm ]
Post subject:  Re: 2dPie abilities

Thanks for your explanation but :

$PieChart->draw2DPie(100,100,array("Radius"=>45,"Border"=>TRUE,"WriteValues"=>PIE_VALUE_PERCENTAGE));
Display nothing but empty pie
$PieChart->draw2DPie(100,100,array("Radius"=>45,"Border"=>TRUE,"DrawLabels"=>PIE_VALUE_PERCENTAGE));
Display Labels around pie with arrows
$PieChart->draw2DPie(100,100,array("Radius"=>45,"Border"=>TRUE,"WriteLabels"=>PIE_VALUE_PERCENTAGE));
WriteLabels -> NOT EXIST in pPie.class.php :) and return pie without text outside or inside

Indeed, in function draw2DPie()
I only see
$DrawLabels = isset($Format["DrawLabels"]) ? $Format["DrawLabels"] : FALSE;

You may have forget to add this ability in function
I'm surprised because it seems easier than for 3d one ?

Can you confirm that i'm right and what i'm trying to do does not yet exists in your class?

Author:  jean-damien [ Tue Apr 05, 2011 2:52 pm ]
Post subject:  Re: 2dPie abilities

I've mixed the parameters names sorry ;o)

In the 2D pie it is called WriteValues and not WriteLabels as I've written below. If I remember well, this parameter has been added in the latest 2.1.1 subversion.

Code:
$Settings=array("Radius"=>45,"Border"=>TRUE,"WriteValues"=>PIE_VALUE_NATURAL);
$PieChart->draw2DPie(100,100,$Settings);


JD.

Author:  asba [ Tue Apr 05, 2011 2:58 pm ]
Post subject:  Re: 2dPie abilities

I'm sorry i mean :

In your pPie.class.php in function draw2DPie() there's NO

$WriteValues declared

So it won't work

I'm using 2.1.0 for your information :)

Author:  jean-damien [ Tue Apr 05, 2011 2:59 pm ]
Post subject:  Re: 2dPie abilities

You'll have to upgrade ;o)

Author:  asba [ Tue Apr 05, 2011 2:59 pm ]
Post subject:  Re: 2dPie abilities

Sorry i've just read what you say about svn ...
I will get this latest revision thanks

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/