Exemplo n.º 1
0
foreach ($Labels as $i => &$value) {
    if ($i != 0 && $i != count($Labels) - 1) {
        $value = '';
    }
}
$Plot = new Plot("sportler_weights", 320, 150);
if ($Plugin->Configuration()->value('use_weight')) {
    $Plot->Data[] = array('label' => __('Weight'), 'color' => '#008', 'data' => $Weights);
}
if ($Plugin->Configuration()->value('use_pulse')) {
    $Plot->Data[] = array('label' => __('Resting HR'), 'color' => '#800', 'data' => $HRrests, 'yaxis' => 2);
}
$Plot->setMarginForGrid(5);
$Plot->setXLabels($Labels);
$Plot->setXAxisTimeFormat('%m/%y');
$Plot->setXAxisMaxToToday();
$Plot->Options['xaxis']['labelWidth'] = 50;
//$Plot->Options['xaxis']['tickLength'] = 3;
$Plot->Options['series']['curvedLines']['fit'] = true;
$Plot->addYAxis(1, 'left');
$Plot->addYUnit(1, 'kg', 1);
$Plot->setYTicks(1, 2, 0);
$Plot->addYAxis(2, 'right', false);
$Plot->addYUnit(2, 'bpm', 0);
$Plot->setYTicks(2, 1, 0);
if ($Wunschgewicht > 1) {
    $Plot->addThreshold('y1', $Wunschgewicht);
    $Plot->addMarkingArea('y1', $Wunschgewicht, 0);
}
if (empty($Data)) {
    $Plot->raiseError(__('No data available.'));