Skip to content

Commit

Permalink
Merge branch '2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
szymach committed Jul 15, 2017
2 parents bc4a5b7 + aba6cda commit 575c362
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Build status:

Code quality:
=============
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/szymach/c-pchart/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/szymach/c-pchart/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/szymach/c-pchart/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/szymach/c-pchart/?branch=master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/szymach/c-pchart/badges/quality-score.png?b=2.0)](https://scrutinizer-ci.com/g/szymach/c-pchart/?branch=2.0)
[![Code Coverage](https://scrutinizer-ci.com/g/szymach/c-pchart/badges/coverage.png?b=2.0)](https://scrutinizer-ci.com/g/szymach/c-pchart/?branch=2.0)

About:
======
Expand Down
4 changes: 2 additions & 2 deletions src/Barcode/Barcode128.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ public function encode128($Value, $Format = "")
* @param string $Value
* @param int $X
* @param int $Y
* @param string $Format
* @param array $Format
*/
public function draw(Image $Object, $Value, $X, $Y, $Format = "")
public function draw(Image $Object, $Value, $X, $Y, $Format = [])
{
$this->pChartObject = $Object;

Expand Down
2 changes: 1 addition & 1 deletion src/Barcode/Barcode39.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function encode39($Value)
* @param type $Y
* @param array $Format
*/
public function draw(Image $Object, $Value, $X, $Y, $Format = "")
public function draw(Image $Object, $Value, $X, $Y, $Format = [])
{
$this->pChartObject = $Object;

Expand Down
23 changes: 12 additions & 11 deletions src/BaseDraw.php
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ public function writeLabel($SeriesName, $Indexes, array $Format = [])
}

$MinY = $this->GraphAreaY2;
foreach ($SeriesName as $iKey => $SerieName) {
foreach ($SeriesName as $SerieName) {
if (isset($Data["Series"][$SerieName]["Data"][$Index])) {
$AxisID = $Data["Series"][$SerieName]["Axis"];
$XAxisMode = $Data["XAxisDisplay"];
Expand All @@ -1417,6 +1417,7 @@ public function writeLabel($SeriesName, $Indexes, array $Format = [])
$AxisMode = $Data["Axis"][$AxisID]["Display"];
$AxisFormat = $Data["Axis"][$AxisID]["Format"];
$AxisUnit = $Data["Axis"][$AxisID]["Unit"];
$XLabel = "";

if (isset($Data["Abscissa"])
&& isset($Data["Series"][$Data["Abscissa"]]["Data"][$Index])
Expand All @@ -1427,9 +1428,8 @@ public function writeLabel($SeriesName, $Indexes, array $Format = [])
$XAxisFormat,
$XAxisUnit
);
} else {
$XLabel = "";
}

if ($OverrideTitle != null) {
$Description = $OverrideTitle;
} elseif (count($SeriesName) == 1) {
Expand All @@ -1439,12 +1439,13 @@ public function writeLabel($SeriesName, $Indexes, array $Format = [])
) {
$Description = $XLabel;
}
$Serie = "";
$Serie["R"] = $Data["Series"][$SerieName]["Color"]["R"];
$Serie["G"] = $Data["Series"][$SerieName]["Color"]["G"];
$Serie["B"] = $Data["Series"][$SerieName]["Color"]["B"];
$Serie["Alpha"] = $Data["Series"][$SerieName]["Color"]["Alpha"];

$Serie = [
"R" => $Data["Series"][$SerieName]["Color"]["R"],
"G" => $Data["Series"][$SerieName]["Color"]["G"],
"B" => $Data["Series"][$SerieName]["Color"]["B"],
"Alpha" => $Data["Series"][$SerieName]["Color"]["Alpha"]
];
if (count($SeriesName) == 1
&& isset($Data["Series"][$SerieName]["XOffset"])
) {
Expand Down Expand Up @@ -1568,6 +1569,7 @@ public function writeLabel($SeriesName, $Indexes, array $Format = [])
$AxisMode = $Data["Axis"][$AxisID]["Display"];
$AxisFormat = $Data["Axis"][$AxisID]["Format"];
$AxisUnit = $Data["Axis"][$AxisID]["Unit"];
$XLabel = "";

if (isset($Data["Abscissa"])
&& isset($Data["Series"][$Data["Abscissa"]]["Data"][$Index])
Expand All @@ -1578,9 +1580,8 @@ public function writeLabel($SeriesName, $Indexes, array $Format = [])
$XAxisFormat,
$XAxisUnit
);
} else {
$XLabel = "";
}

if ($OverrideTitle != null) {
$Description = $OverrideTitle;
} elseif (count($SeriesName) == 1) {
Expand All @@ -1594,7 +1595,7 @@ public function writeLabel($SeriesName, $Indexes, array $Format = [])
) {
$Description = $XLabel;
}
$Serie = "";
$Serie = [];
if (isset($Data["Extended"]["Palette"][$Index])) {
$Serie["R"] = $Data["Extended"]["Palette"][$Index]["R"];
$Serie["G"] = $Data["Extended"]["Palette"][$Index]["G"];
Expand Down
12 changes: 6 additions & 6 deletions src/Chart/Bubble.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public function __construct(Image $pChartObject, Data $pDataObject)
/**
* Prepare the scale
*
* @param type $DataSeries
* @param type $WeightSeries
* @param mixed $DataSeries
* @param mixed $WeightSeries
*/
public function bubbleScale($DataSeries, $WeightSeries)
{
Expand All @@ -56,8 +56,8 @@ public function bubbleScale($DataSeries, $WeightSeries)
}

/* Parse each data series to find the new min & max boundaries to scale */
$NewPositiveSerie = "";
$NewNegativeSerie = "";
$NewPositiveSerie = [];
$NewNegativeSerie = [];
$MaxValues = 0;
$LastPositive = 0;
$LastNegative = 0;
Expand Down Expand Up @@ -95,7 +95,7 @@ public function bubbleScale($DataSeries, $WeightSeries)
}

/* Check for missing values and all the fake positive serie */
if ($NewPositiveSerie != "") {
if (count($NewPositiveSerie)) {
for ($i = 0; $i < $MaxValues; $i++) {
if (!isset($NewPositiveSerie[$i])) {
$NewPositiveSerie[$i] = $LastPositive;
Expand All @@ -105,7 +105,7 @@ public function bubbleScale($DataSeries, $WeightSeries)
}

/* Check for missing values and all the fake negative serie */
if ($NewNegativeSerie != "") {
if (count($NewNegativeSerie)) {
for ($i = 0; $i < $MaxValues; $i++) {
if (!isset($NewNegativeSerie[$i])) {
$NewNegativeSerie[$i] = $LastNegative;
Expand Down

0 comments on commit 575c362

Please sign in to comment.