- global $decseps, $graph_skin;
- $pg->x = array(_('Current'), $nowdue, $pastdue1, $pastdue2);
- $pg->title = $rep->title;
- $pg->axis_x = _("Days");
- $pg->axis_y = _("Amount");
- $pg->graphic_1 = $to;
- $pg->type = $graphics;
- $pg->skin = $graph_skin;
- $pg->built_in = false;
- $pg->fontfile = $path_to_root . "/reporting/fonts/Vera.ttf";
- $pg->latin_notation = ($decseps[$_SESSION["wa_current_user"]->prefs->dec_sep()] != ".");
- $filename = company_path(). "/images/test.png";
- $pg->display($filename, true);
+ $pg->setStream('png');
+ $pg->addSerie(_('Balances'), $serie);
+ $pg->setLabels(array(_('Current'), $nowdue, $pastdue1, $pastdue2));
+ $pg->setTitle($rep->title);
+ $pg->setXTitle(_("Days"));
+ $pg->setYTitle(_("Amount"));
+ $pg->setDTitle(number_format2($total[4]));
+ $pg->setValues(true);
+ $pg->latin_notation = ($SysPrefs->decseps[user_dec_sep()] != ".");
+ $filename = company_path(). "/pdf_files/". random_id().".png";
+ $pg->display($filename);
+ //sleep(5);