in function _chart_adjust_resolution($chart_id, &$data, $max_value = NULL) counts $divider and $multiplier values, that rounds to 0.0 accuracy:

    if ($max[$chart_id] > $resoluton){
      $divider = round($max[$chart_id] / $resoluton, 1);
    }
    else {
      $multiplier = round($resoluton / $max[$chart_id], 1);
    }

But when I use different values, very often chart never got 100 and 99 values for maxumum data peaks!

I think we must remove rounding of $divider and $multiplier values.

If I change this code to

    if ($max[$chart_id] > $resoluton){
      $divider = $max[$chart_id] / $resoluton;
    }
    else {
      $multiplier = $resoluton / $max[$chart_id];
    }

my charts looks better and more precisely.

CommentFileSizeAuthor
#1 chart-remove-rounding-868092-1.patch619 bytes13rac1

Comments

13rac1’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new619 bytes

Agreed. Patch for 7.x-1.x-dev attached.

13rac1’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Needs review » Patch (to be ported)

Patch applied to 7.x-1.x-dev. Needed in 6.x-1.x-dev.

13rac1’s picture

Status: Patch (to be ported) » Fixed

Applied to 6.x-1.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.