I set this: $plot->SetPlotAreaWorld(0, 99.9, NULL, 100); becouse I only
want to see the X-Values obove 99.9 (This will be %). Works fine, but when there is a Value
below (maybe 99.1) the line goes through the x axis and the label to the
bottom of the whole diagram. Can I suppress that?
No, there isn't any way to do this. It makes sense that PHPlot should clip the graph values to the plot area, but there doesn't seem to be a straight-forward way to do this in PHP with GD. Changing the draw order won't help since the image background has to go first, then the plot area background overlays it, then the graph.
The only way I could see doing it with PHP and GD would be to draw the graph into a temporary image of exactly the right size, then copy it to the main image. But that doesn't seem worth the effort and possible performance hit.
Anyone else with ideas? (I'm not writing my own clipping routines. Sorry.)
Now, you could perhaps pre-process your data, replacing all Y values with NULL if they are outside the range. Not quite the same as clipping, since missing Y values are skipped (see SetDrawBrokenLines), but it might work.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
<< The only way I could see doing it with PHP and GD would be to draw the graph into a temporary image of exactly the right size, then copy it to the main image. But that doesn't seem worth the effort and possible performance hit. >>
Got no skills with GD so I am not able to try :-)
<< Now, you could perhaps pre-process your data, replacing all Y values with NULL if they are outside the range. Not quite the same as clipping, since missing Y values are skipped (see SetDrawBrokenLines), but it might work. >>
Works somehow, but I will have to explain that all values which are missing were too bad for the diagramm :-)
<< Anyone else with ideas? (I'm not writing my own clipping routines. Sorry.) >>
Someone else wants to write one?! Or am I the only one with this problem?! :-(
Thank you
Dominik
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Unfortunately, no, it is still an issue with lack of support for a clipping
window in PHP/GD. I did look into again a few months ago, and I found that the
GD library does in fact support a clipping rectangle (gdImageSetClip), but the
PHP interface to GD does not provide access to this feature. So I opened a
feature request with PHP to provide a function for this. Here is the request: http://bugs.php.net/bug.php?id=52857
I don't think it would be that hard to add this to the PHP/GD extension - it
is just a wrapper around the GD function - but there has been no response to
the feature request.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I set this: $plot->SetPlotAreaWorld(0, 99.9, NULL, 100); becouse I only
want to see the X-Values obove 99.9 (This will be %). Works fine, but when there is a Value
below (maybe 99.1) the line goes through the x axis and the label to the
bottom of the whole diagram. Can I suppress that?
http://img530.imageshack.us/img530/8861/examplez.png
Thanks
Dominik
(I think you mean Y values, not X values)
No, there isn't any way to do this. It makes sense that PHPlot should clip the graph values to the plot area, but there doesn't seem to be a straight-forward way to do this in PHP with GD. Changing the draw order won't help since the image background has to go first, then the plot area background overlays it, then the graph.
The only way I could see doing it with PHP and GD would be to draw the graph into a temporary image of exactly the right size, then copy it to the main image. But that doesn't seem worth the effort and possible performance hit.
Anyone else with ideas? (I'm not writing my own clipping routines. Sorry.)
Now, you could perhaps pre-process your data, replacing all Y values with NULL if they are outside the range. Not quite the same as clipping, since missing Y values are skipped (see SetDrawBrokenLines), but it might work.
<< (I think you mean Y values, not X values) >>
Yes, sure... :-)
<< The only way I could see doing it with PHP and GD would be to draw the graph into a temporary image of exactly the right size, then copy it to the main image. But that doesn't seem worth the effort and possible performance hit. >>
Got no skills with GD so I am not able to try :-)
<< Now, you could perhaps pre-process your data, replacing all Y values with NULL if they are outside the range. Not quite the same as clipping, since missing Y values are skipped (see SetDrawBrokenLines), but it might work. >>
Works somehow, but I will have to explain that all values which are missing were too bad for the diagramm :-)
<< Anyone else with ideas? (I'm not writing my own clipping routines. Sorry.) >>
Someone else wants to write one?! Or am I the only one with this problem?! :-(
Thank you
Dominik
Is there any possibility to do this in the new Version 5.3.0?
Thank you
Dominik
Unfortunately, no, it is still an issue with lack of support for a clipping
window in PHP/GD. I did look into again a few months ago, and I found that the
GD library does in fact support a clipping rectangle (gdImageSetClip), but the
PHP interface to GD does not provide access to this feature. So I opened a
feature request with PHP to provide a function for this. Here is the request:
http://bugs.php.net/bug.php?id=52857
I don't think it would be that hard to add this to the PHP/GD extension - it
is just a wrapper around the GD function - but there has been no response to
the feature request.