You are here

function pData::getCoefficientOfVariation in Visitors 7

Same name and namespace in other branches
  1. 7.2 pChart/class/pData.class.php \pData::getCoefficientOfVariation()

File

pChart/class/pData.class.php, line 329

Class

pData

Code

function getCoefficientOfVariation($Serie) {
  if (isset($this->Data["Series"][$Serie])) {
    $Average = $this
      ->getSerieAverage($Serie);
    $StandardDeviation = $this
      ->getStandardDeviation($Serie);
    if ($StandardDeviation != 0) {
      return $StandardDeviation / $Average;
    }
    else {
      return NULL;
    }
  }
  else {
    return NULL;
  }
}