New dashboard and Graphics Engine Class, that also includes the SVG Vector Graphics...
[fa-stable.git] / reporting / rep202.php
index 04d1afa1d5365b735759ebde3e44376685740745..0e122ab4f25a4f5c6bc9587a896dc14e030a3d06 100644 (file)
@@ -91,7 +91,8 @@ function print_aged_supplier_analysis()
        if ($graphics)
        {
                include_once($path_to_root . "/reporting/includes/class.graphic.inc");
-               $pg = new graph();
+               $pg = new chart($graphics);
+               $serie = array();
        }
 
        if ($fromsupp == ALL_TEXT)
@@ -237,21 +238,21 @@ function print_aged_supplier_analysis()
                $rep->AmountCol($i + 3, $i + 4, $total[$i], $dec);
                if ($graphics && $i < count($total) - 1)
                {
-                       $pg->y[$i] = abs($total[$i]);
+                       $serie[$i] = abs($total[$i]);
                }
        }
        $rep->Line($rep->row  - 8);
        $rep->NewLine();
        if ($graphics)
        {
-               $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      = $SysPrefs->graph_skin;
-               $pg->built_in  = false;
+               $pg->setStream('png');
+               $pg->setLabels(array(_('Current'), $nowdue, $pastdue1, $pastdue2));
+               $pg->addSerie(_("Balances"), $serie);
+               $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, true);