Menu

Top (and right) margin is not honored by plot

Toewe
2015-12-28
2015-12-30
  • Toewe

    Toewe - 2015-12-28

    Love the product and have been using for many years but wanted to ask about a minor issue which may be nothing more than my ignorance.

    I am using the stackedbars style plot and have set all four margins via $plot->SetMarginsPixels(50,62,40,125). If I let phplot determine the Y axis plot range, the data is nicely contained within the border defined by my margins. However, if I override the Y axis max value using $plot->SetPlotAreaWorld(null, null, null, $vmax), and the value of $vmax is less than the largest data point value, the plotted bars extend off the top of the plot area and into the top margin area. Is that a feature? or a fault? or am I not using Phplot correctly?

    The same thing happens on the X axis max value, but neither of the minimum axis values have this issue.

    Hope this is clear, was not aable to insert an image example.

     
  • lbayuk

    lbayuk - 2015-12-29

    If I understand what you are seeing, no, it isn't a feature and it isn't your fault. It's a bug, due to a missing feature in PHP. The bug report for PHPlot is here: [bugs:#146]. What's missing is the ability to set up a clipping area so the plot is clipped to the plot area. The graphics library that PHPlot uses, GD, does have this ability, but the PHP GD extension doesn't have a way to use it. I wrote up a PHP feature request for this a number of years ago but unfortunately nothing has happened there.

     

    Related

    Bugs: #146

  • Toewe

    Toewe - 2015-12-30

    Thanks lbayuk. You understood perfectly and do a great job of maintaining Phplot.

     

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.