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



Reply to topic  [ 3 posts ] 
Tunning my pChart 
Author Message
New pChart user
New pChart user

Joined: Thu May 31, 2012 9:27 am
Posts: 2
Post Tunning my pChart
Hi,

I'm new in pChart, i've build my chart with the values i need but now i'm not sure how to implement some transformations.

1) My scale in 0, 0.1, 0.2, 0.3, etc ... but i want to be integer jumping 1 2 3 4 etc.... How can i manage this ?

2) My graph has lots of series, is it possible to put the name of the series in the axis near "Q9" and "Q8" ? The series are showed in the legend but i prefer to take of the legend and the name of each series appears near each bar.

3) How can i separate, with a different background for example, to separate the diferent series ("Q9" and "Q8")?

Best regards,
Hugo Gomes


Attachments:
File comment: My plot doubts
plots.jpg
plots.jpg [ 154.24 KiB | Viewed 5983 times ]
Thu May 31, 2012 11:02 am
Profile
Experienced pChart user
Experienced pChart user

Joined: Tue Aug 02, 2011 11:49 pm
Posts: 34
Post Re: Tunning my pChart
answer to question 1)

you can create a seperate array, like this
Code:
$integerUnits = array("0","","","","","","","","","","1","","","","","","","","","","2","","","","","","","","","","3","","","","","","","","","","4","","","","","","","","","","5","","","","","","","","","","6","","","","","","","","","","7","","","","","","","","","","8","","","","","","","","","","9","","","","","","","","","","10");
you put it into pData() like your other series and create your tuned abscissa
Code:
$MyData = new pData();
[...]
$MyData->addPoints($integerUnits,"call-it-what-you-want");
[...]
$MyData->setAbscissa("call-it-what-you-want");
$MyData->setAbscissaName("NGI's");
see also documentation http://wiki.pchart.net/doc.dataset.setabscissa.html

answer to question 2)

just don't draw the legend, comment it out /* $myPicture->drawLegend([...]); */ and see also documentation http://wiki.pchart.net/doc.doc.draw.legend.html

use writeLabel(); instead and put your small labels next to the series they belong to, and guess what, see also documentation http://wiki.pchart.net/doc.draw.writeLabel.html

answer to question 3)

I'm not sure, perhaps you can put some partly transparent rectangles in the background, afterwards draw the scale as usual and finally draw the series
Code:
$myPicture->drawFilledRectangle([...]);
$myPicture->drawFilledRectangle([...]);
$myPicture->drawFilledRectangle([...]);
[...]
$myPicture->drawScale([...]);
$myPicture->drawBarChart([...]);

http://wiki.pchart.net/doc.doc.draw.scale.html
http://wiki.pchart.net/doc.draw.rectangle.html
http://wiki.pchart.net/doc.draw.gradientarea.html
http://wiki.pchart.net/doc.chart.drawbarchart.html


Thu May 31, 2012 1:44 pm
Profile
New pChart user
New pChart user

Joined: Thu May 31, 2012 9:27 am
Posts: 2
Post Re: Tunning my pChart
Hi,

Thank you for the suggestions, I will try it out, the documention I've already consult it, that's how I figure it out to build the plot, but these small tunning i couldn't understand how it works on documentation.

Thanks for your help.


Thu May 31, 2012 2:37 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 36 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