Menu

SetPlotAreaWorld - Values below x-axis...

dsta
2009-06-15
2012-09-07
  • dsta

    dsta - 2009-06-15

    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

     
    • lbayuk

      lbayuk - 2009-06-16

      (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.

       
    • dsta

      dsta - 2009-06-16

      << (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

       
  • dsta

    dsta - 2010-12-09

    Is there any possibility to do this in the new Version 5.3.0?

    Thank you

    Dominik

     
  • lbayuk

    lbayuk - 2010-12-09

    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.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.