Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Giehl <stefan@piwik.org>2017-04-03 20:44:25 +0300
committerMatthieu Aubry <mattab@users.noreply.github.com>2017-04-03 20:44:25 +0300
commitc79e15605bb7e2ee632ddc63b1b271df08944b42 (patch)
tree5d363d4f5b713dfd8ebef216ddc8fba98f6e28aa /plugins/ImageGraph
parenteb121d6a338858738bf5d4cc3d6e907f72208f40 (diff)
replace pChart with CpChart (#11559)
Diffstat (limited to 'plugins/ImageGraph')
-rw-r--r--plugins/ImageGraph/API.php2
-rw-r--r--plugins/ImageGraph/StaticGraph.php20
-rw-r--r--plugins/ImageGraph/StaticGraph/Exception.php4
-rw-r--r--plugins/ImageGraph/StaticGraph/PieGraph.php10
4 files changed, 15 insertions, 21 deletions
diff --git a/plugins/ImageGraph/API.php b/plugins/ImageGraph/API.php
index b596fe6d37..e9f15d0b04 100644
--- a/plugins/ImageGraph/API.php
+++ b/plugins/ImageGraph/API.php
@@ -263,7 +263,7 @@ class API extends \Piwik\Plugin\API
case StaticGraph::GRAPH_TYPE_BASIC_PIE:
if (count($ordinateColumns) > 1) {
- // pChart doesn't support multiple series on pie charts
+ // CpChart doesn't support multiple series on pie charts
throw new Exception("Pie charts do not currently support multiple series");
}
diff --git a/plugins/ImageGraph/StaticGraph.php b/plugins/ImageGraph/StaticGraph.php
index 3cd7b738ee..1f74457e7d 100644
--- a/plugins/ImageGraph/StaticGraph.php
+++ b/plugins/ImageGraph/StaticGraph.php
@@ -9,17 +9,13 @@
namespace Piwik\Plugins\ImageGraph;
-use pData;
-use pImage;
+use CpChart\Chart\Data;
+use CpChart\Chart\Image;
use Piwik\Container\StaticContainer;
use Piwik\NumberFormatter;
use Piwik\Piwik;
use Piwik\BaseFactory;
-require_once PIWIK_INCLUDE_PATH . "/libs/pChart/class/pDraw.class.php";
-require_once PIWIK_INCLUDE_PATH . "/libs/pChart/class/pImage.class.php";
-require_once PIWIK_INCLUDE_PATH . "/libs/pChart/class/pData.class.php";
-
/**
* The StaticGraph abstract class is used as a base class for different types of static graphs.
*
@@ -45,11 +41,11 @@ abstract class StaticGraph extends BaseFactory
private $aliasedGraph;
/**
- * @var pImage
+ * @var Image
*/
protected $pImage;
/**
- * @var pData
+ * @var Data
*/
protected $pData;
protected $ordinateLabels;
@@ -102,7 +98,7 @@ abstract class StaticGraph extends BaseFactory
public function sendToDisk($filename)
{
$filePath = self::getOutputPath($filename);
- $this->pImage->Render($filePath);
+ $this->pImage->render($filePath);
return $filePath;
}
@@ -238,7 +234,7 @@ abstract class StaticGraph extends BaseFactory
protected function initpData()
{
- $this->pData = new pData();
+ $this->pData = new Data();
foreach ($this->ordinateSeries as $column => $data) {
$this->pData->addPoints($data, $column);
@@ -257,7 +253,7 @@ abstract class StaticGraph extends BaseFactory
protected function initpImage()
{
- $this->pImage = new pImage($this->width, $this->height, $this->pData);
+ $this->pImage = new Image($this->width, $this->height, $this->pData);
$this->pImage->Antialias = $this->aliasedGraph;
$this->pImage->setFontProperties(
@@ -347,7 +343,7 @@ abstract class StaticGraph extends BaseFactory
/**
* Global format method
*
- * required to format y axis values using pcharts internal format callbacks
+ * required to format y axis values using CpChart internal format callbacks
* @param $value
* @return mixed
*/
diff --git a/plugins/ImageGraph/StaticGraph/Exception.php b/plugins/ImageGraph/StaticGraph/Exception.php
index eca980e3b2..dd10193365 100644
--- a/plugins/ImageGraph/StaticGraph/Exception.php
+++ b/plugins/ImageGraph/StaticGraph/Exception.php
@@ -8,7 +8,7 @@
*/
namespace Piwik\Plugins\ImageGraph\StaticGraph;
-use pData;
+use CpChart\Chart\Data;
use Piwik\Plugins\ImageGraph\StaticGraph;
/**
@@ -51,7 +51,7 @@ class Exception extends StaticGraph
public function renderGraph()
{
- $this->pData = new pData();
+ $this->pData = new Data();
$message = $this->exception->getMessage();
list($textWidth, $textHeight) = $this->getTextWidthHeight($message);
diff --git a/plugins/ImageGraph/StaticGraph/PieGraph.php b/plugins/ImageGraph/StaticGraph/PieGraph.php
index d3e88b52f4..a43a6ff631 100644
--- a/plugins/ImageGraph/StaticGraph/PieGraph.php
+++ b/plugins/ImageGraph/StaticGraph/PieGraph.php
@@ -9,10 +9,8 @@
namespace Piwik\Plugins\ImageGraph\StaticGraph;
+use CpChart\Chart\Pie;
use Piwik\Plugins\ImageGraph\StaticGraph;
-use pPie;
-
-require_once PIWIK_INCLUDE_PATH . "/libs/pChart/class/pPie.class.php";
/**
*
@@ -26,7 +24,7 @@ abstract class PieGraph extends StaticGraph
const SLICE_COLOR_KEY = "SLICE_COLOR";
/**
- * @var pPie
+ * @var Pie
*/
protected $pieChart;
protected $xPosition;
@@ -57,7 +55,7 @@ abstract class PieGraph extends StaticGraph
$radius = ($this->height / 2) - self::RADIUS_MARGIN;
}
- $this->pieChart = new pPie($this->pImage, $this->pData);
+ $this->pieChart = new Pie($this->pImage, $this->pData);
$numberOfSlices = count($this->abscissaSeries);
$numberOfAvailableColors = count($this->colors);
@@ -89,7 +87,7 @@ abstract class PieGraph extends StaticGraph
* it uses a threshold to determine if an abscissa value should be drawn on the PIE
* discarded abscissa values are summed in the 'other' abscissa value
*
- * if this process is not perform, pChart will draw pie slices that are too small to see
+ * if this process is not perform, CpChart will draw pie slices that are too small to see
*/
private function truncateSmallValues()
{