Example #1
0
     $datamin[$i] = $acct->min_desired;
 }
 // Fabrication tableau 4b
 $file = $conf->banque->dir_temp . "/movement" . $account . "-" . $year . ".png";
 $fileurl = DOL_URL_ROOT . '/viewimage.php?modulepart=banque_temp&file=' . "/movement" . $account . "-" . $year . ".png";
 $title = $langs->transnoentities("BankMovements") . ' - ' . $langs->transnoentities("Year") . ': ' . $year;
 $graph_datas = array();
 foreach ($data_credit as $i => $val) {
     $graph_datas[$i] = array($labels[$i], $data_credit[$i], $data_debit[$i]);
 }
 $px5 = new DolGraph();
 $px5->SetData($graph_datas);
 $px5->SetLegend(array($langs->transnoentities("Credit"), $langs->transnoentities("Debit")));
 $px5->SetLegendWidthMin(180);
 $px5->SetMaxValue($px5->GetCeilMaxValue() < 0 ? 0 : $px5->GetCeilMaxValue());
 $px5->SetMinValue($px5->GetFloorMinValue() > 0 ? 0 : $px5->GetFloorMinValue());
 $px5->SetTitle($title);
 $px5->SetWidth($WIDTH);
 $px5->SetHeight($HEIGHT);
 $px5->SetType(array('bars', 'bars'));
 $px5->SetShading(3);
 $px5->setBgColor('onglet');
 $px5->setBgColorGrid(array(255, 255, 255));
 $px5->SetHorizTickIncrement(1);
 $px5->SetPrecisionY(0);
 $px5->draw($file, $fileurl);
 $show5 = $px5->show();
 unset($graph_datas);
 unset($px5);
 unset($debits);
 unset($credits);
Example #2
0
    }
}
$px3 = new DolGraph();
$mesg = $px3->isGraphKo();
if (!$mesg) {
    $px3->SetData($data);
    $i = $startyear;
    $legend = array();
    while ($i <= $endyear) {
        $legend[] = $i;
        $i++;
    }
    $px3->SetLegend($legend);
    $px3->SetYLabel($langs->trans("AmountAverage"));
    $px3->SetMaxValue($px3->GetCeilMaxValue());
    $px3->SetMinValue($px3->GetFloorMinValue());
    $px3->SetWidth($WIDTH);
    $px3->SetHeight($HEIGHT);
    $px3->SetShading(3);
    $px3->SetHorizTickIncrement(1);
    $px3->SetPrecisionY(0);
    $px3->mode = 'depth';
    $px3->SetTitle($langs->trans("AmountAverage"));
    $px3->draw($filename_avg, $fileurl_avg);
}
// Show array
$data = $stats->getAllByYear();
$arrayyears = array();
foreach ($data as $val) {
    $arrayyears[$val['year']] = $val['year'];
}
Example #3
0
    }
}
$px1 = new DolGraph();
$mesg = $px1->isGraphKo();
if (!$mesg) {
    $px1->SetData($data);
    $px1->SetPrecisionY(0);
    $i = $startyear;
    $legend = array();
    while ($i <= $endyear) {
        $legend[] = $i;
        $i++;
    }
    $px1->SetLegend($legend);
    $px1->SetMaxValue($px1->GetCeilMaxValue());
    $px1->SetMinValue(min(0, $px1->GetFloorMinValue()));
    $px1->SetWidth($WIDTH);
    $px1->SetHeight($HEIGHT);
    $px1->SetYLabel($langs->trans("NbOfSendings"));
    $px1->SetShading(3);
    $px1->SetHorizTickIncrement(1);
    $px1->SetPrecisionY(0);
    $px1->mode = 'depth';
    $px1->SetTitle($langs->trans("NumberOfShipmentsByMonth"));
    $px1->draw($filenamenb, $fileurlnb);
}
// Build graphic amount of object
/*
$data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear);
//var_dump($data);
// $data = array(array('Lib',val1,val2,val3),...)