$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); } } // Onglets $head = bank_prepare_head($acct); dol_fiche_head($head, 'graph', $langs->trans("FinancialAccount"), 0, 'account'); print '<table class="border" width="100%">';
$graph_datas = array(); for ($i = 0; $i < 12; $i++) { $graph_datas[$i] = array($labels[$i], $data_year_0[$i], $data_year_1[$i], $data_year_2[$i]); } $px2 = new DolGraph(); $px2->SetData($graph_datas); $px2->SetLegend(array($year, $year - 1, $year - 2)); $px2->SetLegendWidthMin(180); $px2->SetMaxValue($px2->GetCeilMaxValue() < 0 ? 0 : $px2->GetCeilMaxValue()); $px2->SetMinValue($px2->GetFloorMinValue() > 0 ? 0 : $px2->GetFloorMinValue()); $px2->SetTitle($title); $px2->SetWidth($width); $px2->SetHeight($height); $px2->SetType(array('line', 'line', 'line')); $px2->SetShading(3); $px2->setBgColor('onglet'); $px2->setBgColorGrid(array(255, 255, 255)); $px2->SetHorizTickIncrement(1); $px2->SetPrecisionY(0); $px2->draw($file, $fileurl); $show2 = $px2->show(); unset($graph_datas); unset($px2); unset($tblyear[0]); unset($tblyear[1]); unset($tblyear[2]); print '<div class="fichecenter"><div class="fichehalfleft"><div align="center">'; // do not use class="center" here, it will have no effect for the js graph inside. print $show1; print '</div></div><div class="fichehalfright"><div class="ficheaddleft"><div align="center">'; // do not use class="center" here, it will have no effect for the js graph inside.