Exemplo n.º 1
0
$Plot->setXAxisAsTime();
if (!$All && !$lastHalf && !$lastYear) {
    $Plot->setXAxisLimitedTo($Year);
}
$Plot->addYAxis(1, 'left');
$Plot->setYTicks(1, 1);
if (Configuration::Trimp()->showInPercent()) {
    $Plot->addYUnit(1, '%');
    $Plot->setYLimits(1, 0, 100);
}
$Plot->addYAxis(2, 'right');
$Plot->setYTicks(2, 1, 1);
$Plot->addYAxis(3, 'right');
$Plot->setYLimits(3, 0, $maxTrimp * 2);
$Plot->showAsBars(3, 1, 2);
$Plot->showAsPoints(4);
$Plot->smoothing(false);
if (($lastHalf || $lastYear) && !$DataFailed) {
    $Plot->addMarkingArea('x', Plot::dayOfYearToJStime($StartYear, $HighestIndex - 30 - $AddDays + $StartDayInYear + 1), $index, 'rgba(255,255,255,0.3)');
    //'rgba(200,200,200,0.5)');
}
$Plot->setGridAboveData();
if ($All) {
    $Plot->setTitle(__('Shape for all years'));
} else {
    $Plot->setTitle(__('Shape') . ' ' . $Year);
}
if ($DataFailed) {
    $Plot->raiseError(__('No data available.'));
}
$Plot->outputJavaScript();
Exemplo n.º 2
0
         Configuration::Data()->updateMaxATL($maxATL);
     }
     if ($perfmodel == 'tsb' && $maxCTL != Configuration::Data()->maxCTL()) {
         Configuration::Data()->updateMaxCTL($maxCTL);
     }
 } else {
     $maxATL = Configuration::Data()->maxATL();
     $maxCTL = Configuration::Data()->maxCTL();
 }
 $showInPercent = Configuration::Trimp()->showInPercent() && $perfmodel != 'banister';
 if (!$showInPercent) {
     $maxATL = 100;
     $maxCTL = 100;
 }
 for ($d = $LowestIndex; $d <= $HighestIndex; $d++) {
     $index = Plot::dayOfYearToJStime($StartYear, $d - $AddDays + $StartDayInYear);
     $ATLs[$index] = 100 * $performanceModel->fatigueAt($d) / $maxATL;
     $CTLs[$index] = 100 * $performanceModel->fitnessAt($d) / $maxCTL;
     $TSBs[$index] = 100 * $performanceModel->performanceAt($d) / $maxCTL;
     $TRIMPs[$index] = $Trimps_raw[$d];
     if ($maxTrimp < $Trimps_raw[$d]) {
         $maxTrimp = $Trimps_raw[$d];
     }
     $VDOT_slice = array_slice($VDOTs_raw, $d - $VDOTdays, $VDOTdays);
     $Durations_slice = array_slice($Durations_raw, $d - $VDOTdays, $VDOTdays);
     $VDOT_sum = array_sum($VDOT_slice);
     $Durations_sum = array_sum($Durations_slice);
     if (count($VDOT_slice) != 0 && $Durations_sum != 0) {
         $VDOTs[$index] = Configuration::Data()->vdotFactor() * ($VDOT_sum / $Durations_sum);
     }
     if ($VDOTs_raw[$d]) {