Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#11 Maximum values not rendered in Resampled Sparkline

open
nobody
None
5
2009-08-21
2009-08-21
Chris Copeland
No

When rendering a Sparkline with this data set all of the maximum values (100 in this example) will be cutoff. This is only a problem when using the Resample option.

I am not sure the root of the problem, but I found that it can be worked around by changing line 227 of Sparkline_Line.php to:
$imageVCHandle = $this->CreateImageHandle($xVC + 1, $yVC + 1);

Discussion

  • Chris Copeland
    Chris Copeland
    2009-08-21

    rendered image without max values

     
    Attachments
  • Chris Copeland
    Chris Copeland
    2009-08-21

    sample code to generate bad image

     
    Attachments
  • Anthon Pang
    Anthon Pang
    2010-02-02

    We had the same problem and used SetYMax as a workaround.

    Digging through the code, it looks like a better fix for this clipping problem would be to replace $yBound with ($yBound-1) in the ConvertDataSeries() function.