My graph result like below, I need to space between axis name or axis label, here need some space margin between "month", and x-axis labels and similarly for "clicks" and y-axis labels.
Asked
Active
Viewed 2,382 times
4 Answers
1
Try to find line no. 2344 in pDraw.class.php
and add value in pixels you want to have as a margin between axis value and the description to the end of the line:
$TxtLeft = $XPos-$OuterTickWidth-2-($Bounds[1]["X"]-$Bounds[0]["X"])
Forexample: $TxtLeft = $XPos-$OuterTickWidth-2-($Bounds[1]["X"]-$Bounds[0]["X"]) - 10;
This will move the text 10 pixels more to the left.

Stéphane Bruckert
- 21,706
- 14
- 92
- 130

Tomas Czech
- 11
- 1
0
You can try something like this -
$scaleSettings = array("XMargin"=>10,
"YMargin"=>10,
"Floating"=>TRUE,
"GridR"=>200,
"GridG"=>200,
"GridB"=>200,
"DrawSubTicks"=>TRUE,
"CycleBackground"=>TRUE);
$myPicture->drawScale($scaleSettings);

Joe Brown
- 637
- 3
- 5
-
hey @joe, I need space between (2011-11) and "Month", check my graph x-axis, your code make space between axis line or graph area, that's i don't need :( – Wiram Rathod Dec 14 '12 at 05:18
0
You could just remove the axis label and draw it with drawText and align the text using TEXT_ALIGN_TOPMIDDLE
and the coordinates from the graph area.

Marcel Burkhard
- 3,453
- 1
- 29
- 35
0
I added two parameters ($XAxisTitleMargin and $YAxisTitleMargin). You may pass just like other parameters. The patch is at: https://gist.github.com/hkjeffchan/4b89545f879bcdc9c638
$Settings = array('XAxisTitleMargin'=>10, 'YAxisTitleMargin' => 10);
$myPicture->drawScale($Settings);

JeffChan
- 188
- 2
- 8