View unanswered posts | View active topics It is currently Mon Jun 17, 2024 8:13 am



Reply to topic  [ 3 posts ] 
Pie chart legend size 
Author Message
Regular pChart user
Regular pChart user

Joined: Thu Mar 31, 2011 9:19 am
Posts: 10
Post Pie chart legend size
Hello

The getLegendSize function return the size of the data series name, wich is not useful for the pie chart legend.
How can I obtain the size of pie chart legend?

best regards

John Rossati


Sat Nov 19, 2011 2:51 am
Profile
Regular pChart user
Regular pChart user

Joined: Thu Mar 31, 2011 9:19 am
Posts: 10
Post Re: Pie chart legend size
Thanks Dan

I would the width of drawPieLegend for adjust to right (how you are suggesting).

best regards

John Rossati


Fri Nov 25, 2011 11:34 pm
Profile
Regular pChart user
Regular pChart user

Joined: Thu Mar 31, 2011 9:19 am
Posts: 10
Post Re: Pie chart legend size
Hello

I work around in this way:

Code:
      $legParms = array("Style"=>LEGEND_ROUND,"Mode"=>LEGEND_VERTICAL);
      $maxLabelWidth = 0;      // search legend width
      foreach($dt->getValues("Labels") as $v) {
         $dt->setSerieDescription($legend,$v);
         $Size = $graph->getLegendSize($legParms);
         $maxLabelWidth = max($maxLabelWidth,$Size["Width"]);
      }      
      $dt->setSerieDescription($legend,$legend);      // Restore original legend

$legend is a variable wich contains the data name

this fragment is part of my pChart "wrapper"

best regards

John Rossati


Fri Dec 02, 2011 2:33 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron