$data_debit[$i] = isset($debits[substr("0" . ($i + 1), -2)]) ? $debits[substr("0" . ($i + 1), -2)] : 0; $labels[$i] = dol_print_date(dol_mktime(12, 0, 0, $i + 1, 1, 2000), "%b"); $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);