Updated libchart and model/stat/chart.php

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO
2020-03-14 08:38:55 +01:00
parent a01a3b9eb5
commit e606c785a2
28 changed files with 3653 additions and 3420 deletions

View File

@ -0,0 +1,112 @@
<?php
/* Libchart - PHP chart library
* Copyright (C) 2005-2011 Jean-Marc Tr<54>meaux (jm.tremeaux at gmail.com)
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
/**
* Configuration attributes of the chart.
*
* @author Jean-Marc Tr<54>meaux (jm.tremeaux at gmail.com)
*/
class ChartConfig {
/**
* Use several colors for a single data set chart (as if it was a multiple data set).
*
* @var Boolean
*/
private $useMultipleColor;
/**
* Show caption on individual data points.
*
* @var Boolean
*/
private $showPointCaption;
/**
* Sort data points (only pie charts).
*
* @var Boolean
*/
private $sortDataPoint;
/**
* Creates a new ChartConfig with default options.
*/
public function ChartConfig() {
$this->useMultipleColor = false;
$this->showPointCaption = true;
$this->sortDataPoint = true;
}
/**
* If true the chart will use several colors for a single data set chart
* (as if it was a multiple data set).
*
* @param $useMultipleColor Use several colors : boolean
*/
public function setUseMultipleColor($useMultipleColor) {
$this->useMultipleColor = $useMultipleColor;
}
/**
* If true the chart will use several colors for a single data set chart
* (as if it was a multiple data set).
*
* @return $useMultipleColor Use several colors : boolean
*/
public function getUseMultipleColor() {
return $this->useMultipleColor;
}
/**
* Set the option to show caption on individual data points.
*
* @param $showPointCaption Show caption on individual data points : boolean
*/
public function setShowPointCaption($showPointCaption) {
$this->showPointCaption = $showPointCaption;
}
/**
* Get the option to show caption on individual data points.
*
* @return Show caption on individual data points : boolean
*/
public function getShowPointCaption() {
return $this->showPointCaption;
}
/**
* Set the option to sort data points (only pie charts).
*
* @param $sortDataPoint Sort data points : boolean
*/
public function setSortDataPoint($sortDataPoint) {
$this->sortDataPoint = $sortDataPoint;
}
/**
* Get the option to sort data points (only pie charts).
*
* @return Sort data points : boolean
*/
public function getSortDataPoint() {
return $this->sortDataPoint;
}
}
?>

View File

@ -1,28 +1,28 @@
<?php
/* Libchart - PHP chart library
* Copyright (C) 2005-2010 Jean-Marc Tr<54>meaux (jm.tremeaux at gmail.com)
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
/**
* Superclass of all data sets.
*
* @author Jean-Marc Tr<54>meaux (jm.tremeaux at gmail.com)
* Created on 10 may 2007
*/
abstract class DataSet {
}
/* Libchart - PHP chart library
* Copyright (C) 2005-2011 Jean-Marc Tr<54>meaux (jm.tremeaux at gmail.com)
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
/**
* Superclass of all data sets.
*
* @author Jean-Marc Tr<54>meaux (jm.tremeaux at gmail.com)
* Created on 10 may 2007
*/
abstract class DataSet {
}
?>

View File

@ -1,59 +1,59 @@
<?php
/* Libchart - PHP chart library
* Copyright (C) 2005-2010 Jean-Marc Tr<54>meaux (jm.tremeaux at gmail.com)
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
/**
* Point of coordinates (X,Y).
* The value of X isn't really of interest, but X is used as a label to display on the horizontal axis.
*
* @author Jean-Marc Tr<54>meaux (jm.tremeaux at gmail.com)
*/
class Point {
private $x;
private $y;
/**
* Creates a new sampling point of coordinates (x, y)
*
* @param integer x coordinate (label)
* @param integer y coordinate (value)
*/
public function Point($x, $y) {
$this->x = $x;
$this->y = $y;
}
/* Libchart - PHP chart library
* Copyright (C) 2005-2011 Jean-Marc Tr<54>meaux (jm.tremeaux at gmail.com)
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
/**
* Point of coordinates (X,Y).
* The value of X isn't really of interest, but X is used as a label to display on the horizontal axis.
*
* @author Jean-Marc Tr<54>meaux (jm.tremeaux at gmail.com)
*/
class Point {
private $x;
private $y;
/**
* Creates a new sampling point of coordinates (x, y)
*
* @param integer x coordinate (label)
* @param integer y coordinate (value)
*/
public function Point($x, $y) {
$this->x = $x;
$this->y = $y;
}
/**
* Gets the x coordinate (label).
*
* @return integer x coordinate (label)
*/
public function getX() {
return $this->x;
}
/**
* Gets the x coordinate (label).
*
* @return integer x coordinate (label)
*/
public function getX() {
return $this->x;
}
/**
* Gets the y coordinate (value).
*
* @return integer y coordinate (value)
*/
public function getY() {
return $this->y;
}
}
/**
* Gets the y coordinate (value).
*
* @return integer y coordinate (value)
*/
public function getY() {
return $this->y;
}
}
?>

View File

@ -1,56 +1,56 @@
<?php
/* Libchart - PHP chart library
* Copyright (C) 2005-2010 Jean-Marc Tr<54>meaux (jm.tremeaux at gmail.com)
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
/**
* Set of data in the form of (x, y) items.
*
* @author Jean-Marc Tr<54>meaux (jm.tremeaux at gmail.com)
* Created on 10 may 2007
*/
class XYDataSet extends DataSet {
private $pointList;
/**
* Constructor of XYDataSet.
*
*/
public function XYDataSet() {
$this->pointList = array();
}
/**
* Add a new point to the dataset.
*
* @param Point Point to add to the dataset
*/
public function addPoint($point) {
array_push($this->pointList, $point);
}
/* Libchart - PHP chart library
* Copyright (C) 2005-2011 Jean-Marc Tr<54>meaux (jm.tremeaux at gmail.com)
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
/**
* Set of data in the form of (x, y) items.
*
* @author Jean-Marc Tr<54>meaux (jm.tremeaux at gmail.com)
* Created on 10 may 2007
*/
class XYDataSet extends DataSet {
private $pointList;
/**
* Constructor of XYDataSet.
*
*/
public function XYDataSet() {
$this->pointList = array();
}
/**
* Add a new point to the dataset.
*
* @param Point Point to add to the dataset
*/
public function addPoint($point) {
array_push($this->pointList, $point);
}
/**
* Getter of pointList.
*
* @return List of points.
*/
public function getPointList() {
return $this->pointList;
}
}
/**
* Getter of pointList.
*
* @return List of points.
*/
public function getPointList() {
return $this->pointList;
}
}
?>

View File

@ -1,76 +1,76 @@
<?php
/* Libchart - PHP chart library
* Copyright (C) 2005-2010 Jean-Marc Tr<54>meaux (jm.tremeaux at gmail.com)
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
/**
* This dataset comprises several series of points and is used to plot multiple lines charts.
* Each serie is a XYDataSet.
*
* @author Jean-Marc Tr<54>meaux (jm.tremeaux at gmail.com)
* Created on 20 july 2007
*/
class XYSeriesDataSet extends DataSet {
/**
* List of titles
*/
private $titleList;
/**
* List of XYDataSet.
*/
private $serieList;
/**
* Constructor of XYSeriesDataSet.
*
*/
public function XYSeriesDataSet() {
$this->titleList = array();
$this->serieList = array();
}
/**
* Add a new serie to the dataset.
*
* @param string Title (label) of the serie.
* @param XYDataSet Serie of points to add
*/
public function addSerie($title, $serie) {
array_push($this->titleList, $title);
array_push($this->serieList, $serie);
}
/**
* Getter of titleList.
*
* @return List of titles.
*/
public function getTitleList() {
return $this->titleList;
}
/* Libchart - PHP chart library
* Copyright (C) 2005-2011 Jean-Marc Tr<54>meaux (jm.tremeaux at gmail.com)
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
*/
/**
* This dataset comprises several series of points and is used to plot multiple lines charts.
* Each serie is a XYDataSet.
*
* @author Jean-Marc Tr<54>meaux (jm.tremeaux at gmail.com)
* Created on 20 july 2007
*/
class XYSeriesDataSet extends DataSet {
/**
* List of titles
*/
private $titleList;
/**
* List of XYDataSet.
*/
private $serieList;
/**
* Constructor of XYSeriesDataSet.
*
*/
public function XYSeriesDataSet() {
$this->titleList = array();
$this->serieList = array();
}
/**
* Add a new serie to the dataset.
*
* @param string Title (label) of the serie.
* @param XYDataSet Serie of points to add
*/
public function addSerie($title, $serie) {
array_push($this->titleList, $title);
array_push($this->serieList, $serie);
}
/**
* Getter of titleList.
*
* @return List of titles.
*/
public function getTitleList() {
return $this->titleList;
}
/**
* Getter of serieList.
*
* @return List of series.
*/
public function getSerieList() {
return $this->serieList;
}
}
/**
* Getter of serieList.
*
* @return List of series.
*/
public function getSerieList() {
return $this->serieList;
}
}
?>