pChart 2.x forum http://wiki.pchart.net/forum/ |
|
Avoid to print the x scale http://wiki.pchart.net/forum/viewtopic.php?f=1&t=2171 |
Page 1 of 1 |
Author: | ciquta [ Tue Sep 13, 2011 9:56 pm ] | ||
Post subject: | 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"); ?>
|
Author: | jean-damien [ Wed Sep 14, 2011 9:34 am ] |
Post subject: | 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. |
Author: | ciquta [ Wed Sep 14, 2011 3:47 pm ] |
Post subject: | 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); |
Author: | jean-damien [ Thu Sep 15, 2011 9:44 am ] |
Post subject: | 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. |
Author: | ciquta [ Thu Sep 15, 2011 3:46 pm ] |
Post subject: | 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 |
Author: | Kozuch [ Thu Nov 08, 2012 10:27 am ] |
Post subject: | 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 |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |