View unanswered posts | View active topics It is currently Sun Apr 28, 2024 8:01 pm



Reply to topic  [ 2 posts ] 
Can't get the Legend to wrap lines in a Scatter Plot 
Author Message
New pChart user
New pChart user

Joined: Tue Jul 26, 2011 10:00 pm
Posts: 2
Post Can't get the Legend to wrap lines in a Scatter Plot
I've got a scatter plot that is based off of a dozen or so series of data that I'm trying to add a horizontal legend to.The problem is the legend ends up drawing right off the edge of the image (i.e., i've got a 600 pixel wide canvas and the legend size is something like 1600 pixels). Does anyone have a solution for this or am I better off putting in a vertical legend instead?


Wed Nov 02, 2011 8:47 pm
Profile
New pChart user
New pChart user

Joined: Thu Jun 07, 2012 7:52 am
Posts: 1
Post Re: Can't get the Legend to wrap lines in a Scatter Plot
I know this is an old post but for anyone else with this same issue I have a very quick and dirty fix. It will need neatening up for proper usage and needs to be done for the legend outline and graph positioning etc

diff pDraw.class.php pDraw.class.php.bak
1613,1618c1613
<
< //Quick and dirty fix to wrap Legend for long text
< $xBeforeWrap = isset($Format["xBeforeWrap"]) ? $Format["xBeforeWrap"] : 800;
< $originalX = $X;
< $originalY = $Y;
<
---
1738,1745d1733
<
< //Quick and dirty Fix
< if ($X >= $xBeforeWrap)
< {
< $Y=$Y+max($this->FontSize*count($Lines),$IconAreaHeight) + 5;
< $X=$originalX;
< }
<


Thu Jun 07, 2012 7:58 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 27 guests


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