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



Reply to topic  [ 6 posts ] 
Avoid to print the x scale 
Author Message
New pChart user
New pChart user

Joined: Tue Sep 13, 2011 9:40 pm
Posts: 3
Post Avoid to print the x scale
I can't avoid the printing of the xscale in this horizontal bar chart, i worked with parameters found here but nothing changes... :?

What's wrong? :?:

Code:
<?php
...

$averagedata->addPoints($wagers,"WAGER");
$averagedata->addPoints($average,"MEDIA");

$averagedata->setAbscissa("WAGER");
$averagedata->setAxisDisplay(0,AXIS_FORMAT_DEFAULT,1);
$averagedata->loadPalette("palettes/green",TRUE);

$averagepicture = new pImage(640,480,$averagedata);

$averagepicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>9));

$averagepicture->setGraphArea(120,20,600,460);
$averagepicture->drawGradientArea(70,160,640,200,DIRECTION_HORIZONTAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>0,"EndG"=>0,"EndB"=>0,"Alpha"=>0));
[b]$scaleSettings = array("ScaleSpacing"=>10,"RemoveXAxis"=>TRUE,"DrawXLines"=>FALSE,"DrawYLines"=>NONE,"Mode"=>SCALE_MODE_START0,"DrawSubTicks"=>FALSE,"GridR"=>0,"GridG"=>0,"GridB"=>0,"GridAlpha"=>0,"Pos"=>SCALE_POS_TOPBOTTOM);[/b]
$averagepicture->drawScale($scaleSettings);
$averagepicture->drawBarChart(array("DisplayPos"=>LABEL_POS_OUTSIDE,"DisplayValues"=>TRUE,"Rounded"=>TRUE,"Surrounding"=>30));

$averagepicture->autoOutput("examples/pictures/averagepicture.png");

?>


Attachments:
a.jpg
a.jpg [ 20.55 KiB | Viewed 10390 times ]
Tue Sep 13, 2011 9:56 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Thu Dec 02, 2010 2:31 pm
Posts: 409
Location: France
Post Re: Avoid to print the x scale
The Axis hilighted in your example is the Y one (your chart is rotated). The RemoveXAxis only exists since the 2.1.3 version, you may be using an outdated one since the X axis still appears.

The Y axis cannot be removed -yet-, you can just skip the Y dashed divisions setting "DrawYLines"=>NONE.

I'll add this feature to the todo list ;o)

JD.


Wed Sep 14, 2011 9:34 am
Profile WWW
New pChart user
New pChart user

Joined: Tue Sep 13, 2011 9:40 pm
Posts: 3
Post Re: Avoid to print the x scale
jean-damien wrote:
The Axis hilighted in your example is the Y one (your chart is rotated). The RemoveXAxis only exists since the 2.1.3 version, you may be using an outdated one since the X axis still appears.

The Y axis cannot be removed -yet-, you can just skip the Y dashed divisions setting "DrawYLines"=>NONE.

I'll add this feature to the todo list ;o)

JD.

Thank you Jean,
you're right, i had the 2.1.2.
Now it's updated and the x-rotated-axis is no more displayed, but i still can see the Y dashed divisions even with "DrawYLines" set to NONE.

with this code i am getting exactly the same result displayed in the previous attachment:
Code:
$scaleSettings = array("DrawYLines"=>NONE,"Mode"=>SCALE_MODE_START0,"GridR"=>0,"GridG"=>0,"GridB"=>0,"GridAlpha"=>0,"Pos"=>SCALE_POS_TOPBOTTOM);
$averagepicture->drawScale($scaleSettings);


Wed Sep 14, 2011 3:47 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Thu Dec 02, 2010 2:31 pm
Posts: 409
Location: France
Post Re: Avoid to print the x scale
Only the ticks on the Axis will appear. You cannot remove the axis, there is no option to do it. This is a very specific request and thus need to be added to the todo list.

JD.


Thu Sep 15, 2011 9:44 am
Profile WWW
New pChart user
New pChart user

Joined: Tue Sep 13, 2011 9:40 pm
Posts: 3
Post Re: Avoid to print the x scale
Ok, thanks.

Could I at least remove the ticks?
Display a thick every 0,2 is useless and very unsightly :|


Thu Sep 15, 2011 3:46 pm
Profile
New pChart user
New pChart user

Joined: Thu May 10, 2012 10:56 am
Posts: 2
Post Re: Avoid to print the x scale
There is a workaround - you can "replace" the Y axis with a white rectangle... use function "drawFilledRectangle" ... btw. there is a similar post located here: viewtopic.php?f=1&t=2287


Thu Nov 08, 2012 10:27 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

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