Exemple #1
0
$Plot->Data[] = array('label' => __('Fatigue (ATL)'), 'color' => '#CC2222', 'data' => $ATLs);
$Plot->Data[] = array('label' => __('avg VDOT'), 'color' => '#000000', 'data' => $VDOTs, 'yaxis' => 2);
$Plot->Data[] = array('label' => 'TRIMP', 'color' => '#5555FF', 'data' => $TRIMPs, 'yaxis' => 3);
$Plot->Data[] = array('label' => __('day VDOT'), 'color' => '#444444', 'data' => $VDOTsday, 'yaxis' => 2);
$Plot->setMarginForGrid(5);
$Plot->setLinesFilled(array(0));
$Plot->setLinesFilled(array(1), 0.3);
$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'));
Exemple #2
0
    foreach ($data as $dat) {
        $yAxis[$id][($dat['day'] + 6) % 7] = $dat['value'] / 3600;
    }
}
$Plot = new Plot("weekday", 350, 190);
$max = 0;
foreach ($yAxis as $key => $data) {
    $Plot->Data[] = array('label' => $key, 'data' => $data);
    $max += max($data);
}
$Plot->setLegendAsTable();
$Plot->setMarginForGrid(5);
$Plot->setXLabels($xAxis);
$Plot->addYAxis(1, 'left');
$Plot->addYUnit(1, 'h');
$Plot->setYTicks(1, 1, 0);
$Plot->setYLimits(1, 0, $max);
$Plot->showBars(true);
$Plot->stacked();
$error = true;
foreach ($yAxis as $t) {
    foreach ($t as $e) {
        if ($e != "0") {
            $error = false;
        }
    }
}
if ($error === true) {
    $Plot->raiseError(__('No data available.'));
}
$Plot->outputJavaScript();