From a3f90255818e8396c9b2551f6803b78307c3888f Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 16 May 2007 14:15:40 +0000 Subject: [PATCH] Nouveau fichier --- .../stats/graph/SimpleBar.class.php | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 htdocs/telephonie/stats/graph/SimpleBar.class.php diff --git a/htdocs/telephonie/stats/graph/SimpleBar.class.php b/htdocs/telephonie/stats/graph/SimpleBar.class.php new file mode 100644 index 00000000000..a01151f4f84 --- /dev/null +++ b/htdocs/telephonie/stats/graph/SimpleBar.class.php @@ -0,0 +1,70 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + * + */ +require_once (DOL_DOCUMENT_ROOT."/../external-libs/Artichow/BarPlot.class.php"); + +class DolibarrSimpleBar { + + Function DolibarrSimpleBar($DB, $file) + { + $this->db = $DB; + $this->file = $file; + $this->barcolor = "green"; + $this->height = 240; + $this->width = 360; + } + + Function GraphDraw($file, $datas, $labels) + { + $group = new PlotGroup; + $group->setPadding(30, 10, NULL, NULL); + + $graph = new Graph($this->width, $this->height); + $graph->border->hide(); + $graph->setAntiAliasing(true); + if (isset($this->titre)) + { + $graph->title->set($this->titre); + $graph->title->setFont(new Tuffy(10)); + } + + $bgcolor= new Color(222,231,236); + $graph->setBackgroundColor($bgcolor); + + + $plot = new BarPlot($datas); + + $plot->barShadow->setSize(2); + $plot->barShadow->setPosition('Shadow::RIGHT_TOP'); + $plot->barShadow->setColor(new Color(160, 160, 160, 10)); + $plot->barShadow->smooth(TRUE); + + $color = new $this->barcolor; + $plot->setBarColor($color); + + $plot->xAxis->setLabelText($labels); + $plot->xAxis->label->setFont(new Tuffy(7)); + + $graph->add($plot); + $graph->draw($file); + } +} +?>