Changeset 71 for trunk/Graph.php


Ignore:
Timestamp:
Jul 8, 2016, 11:11:07 PM (8 years ago)
Author:
chronos
Message:
  • Added: Allow add new values with specified Time parameter.
  • Modified: Use database table columns with names with first capital letter.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Graph.php

    r69 r71  
    6565    foreach($Points as $Index => $Item)
    6666    {
    67       //$Points[$Index]['min'] =  $Points[$Index]['min'] / $Measure['Divider'];
    68       //$Points[$Index]['avg'] =  $Points[$Index]['avg'] / $Measure['Divider'];
    69       //$Points[$Index]['max'] =  $Points[$Index]['max'] / $Measure['Divider'];
    70       if($Points[$Index]['avg'] > $MaxValue) $MaxValue = $Points[$Index]['avg'];
    71       if($Points[$Index]['avg'] < $MinValue) $MinValue = $Points[$Index]['avg'];
    72       if($Points[$Index]['max'] > $MaxValue) $MaxValue = $Points[$Index]['max'];
    73       if($Points[$Index]['min'] < $MinValue) $MinValue = $Points[$Index]['min'];
    74       $AvgValue = $AvgValue + $Points[$Index]['avg'];
     67      //$Points[$Index]['Min'] =  $Points[$Index]['Min'] / $Measure['Divider'];
     68      //$Points[$Index]['Avg'] =  $Points[$Index]['Avg'] / $Measure['Divider'];
     69      //$Points[$Index]['Max'] =  $Points[$Index]['Max'] / $Measure['Divider'];
     70      if($Points[$Index]['Avg'] > $MaxValue) $MaxValue = $Points[$Index]['Avg'];
     71      if($Points[$Index]['Avg'] < $MinValue) $MinValue = $Points[$Index]['Avg'];
     72      if($Points[$Index]['Max'] > $MaxValue) $MaxValue = $Points[$Index]['Max'];
     73      if($Points[$Index]['Min'] < $MinValue) $MinValue = $Points[$Index]['Min'];
     74      $AvgValue = $AvgValue + $Points[$Index]['Avg'];
    7575    }
    7676    //$MinValue = round($MinValue * $Measure['Divider']) / $Measure['Divider'];
     
    8787      {
    8888        $PointsMin[] = $Index * $Width / $Measure->DivisionCount;
    89         $PointsMin[] = $Height - 1 - ($Points[$Index]['min'] - $MinValue) /
     89        $PointsMin[] = $Height - 1 - ($Points[$Index]['Min'] - $MinValue) /
    9090          ($MaxValue - $MinValue) * $Height * $this->ValueToImageHeigthCoefficient;
    9191        $PointsAvg[] = $Index * $Width / $Measure->DivisionCount;
    92         $PointsAvg[] = $Height - 1 - ($Points[$Index]['avg'] - $MinValue) /
     92        $PointsAvg[] = $Height - 1 - ($Points[$Index]['Avg'] - $MinValue) /
    9393          ($MaxValue - $MinValue) * $Height * $this->ValueToImageHeigthCoefficient;
    9494        $PointsMax[] = $Index * $Width / $Measure->DivisionCount;
    95         $PointsMax[] = $Height - 1 - ($Points[$Index]['max'] - $MinValue) /
     95        $PointsMax[] = $Height - 1 - ($Points[$Index]['Max'] - $MinValue) /
    9696          ($MaxValue - $MinValue) * $Height * $this->ValueToImageHeigthCoefficient;
    9797      }
Note: See TracChangeset for help on using the changeset viewer.