Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Add Examples Images and Fixed with PHP 7.1+
Browse files Browse the repository at this point in the history
  • Loading branch information
MHitMaN committed Nov 6, 2018
1 parent 2f6ee62 commit 68a4d26
Show file tree
Hide file tree
Showing 32 changed files with 73 additions and 35 deletions.
Binary file added src/Examples_Images/HomePage3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/Naked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/SmallGraph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/SmallStacked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example22.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example23.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example25.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example26.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Examples_Images/example6.png
Binary file added src/Examples_Images/example7.png
Binary file added src/Examples_Images/example8.png
Binary file added src/Examples_Images/example9.png
36 changes: 36 additions & 0 deletions src/Examples_Images/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<body>
<center>
<img src="example1.png" />
<img src="example2.png" />
<img src="example3.png" />
<img src="example4.png" />
<img src="example5.png" />
<img src="example6.png" />
<img src="example7.png" />
<img src="example8.png" />
<img src="example9.png" />
<img src="example10.png" />
<img src="example11.png" />
<img src="example12.png" />
<img src="example13.png" />
<img src="example14.png" />
<img src="example15.png" />
<img src="example16.png" />
<img src="example17.png" />
<img src="example18.png" />
<img src="example19.png" />
<img src="example20.png" />
<img src="example21.png" />
<img src="example22.png" />
<img src="example23.png" />
<img src="example24.png" />
<img src="example25.png" />
<img src="example26.png" />
<img src="example27.png" />
<img src="example28.png" />
<img src="HomePage3.png" />
<img src="Naked.png" />
<img src="SmallGraph.png" />
<img src="SmallStacked.png" />
</center>
</body>
65 changes: 33 additions & 32 deletions src/pChart/pChart.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
define("ALIGN_BOTTOM_RIGHT", 9);

/* pChart class definition */

class pChart
{
/* Palettes definition */
Expand Down Expand Up @@ -293,7 +294,7 @@ function loadColorPalette($FileName, $Delimiter = ",")
$buffer = fgets($handle, 4096);
$buffer = str_replace(chr(10), "", $buffer);
$buffer = str_replace(chr(13), "", $buffer);
$Values = split($Delimiter, $buffer);
$Values = explode($Delimiter, $buffer);
if (count($Values) == 3) {
$this->Palette[$ColorID]["R"] = $Values[0];
$this->Palette[$ColorID]["G"] = $Values[1];
Expand Down Expand Up @@ -1514,7 +1515,7 @@ function drawArea($Data, $Serie1, $Serie2, $R, $G, $B, $Alpha = 50)
$YPos2 = $LayerHeight - (($Value2 - $this->VMin) * $this->DivisionRatio);

if ($LastXPos != -1) {
$Points = "";
$Points = array();
$Points[] = $LastXPos;
$Points[] = $LastYPos1;
$Points[] = $LastXPos;
Expand Down Expand Up @@ -1662,10 +1663,10 @@ function drawCubicCurve($Data, $DataDescription, $Accuracy = .1, $SerieName = ""
$GraphID = 0;
foreach ($DataDescription["Values"] as $Key2 => $ColName) {
if ($SerieName == "" || $SerieName == $ColName) {
$XIn = "";
$Yin = "";
$Yt = "";
$U = "";
$XIn = array();
$Yin = array();
$Yt = array();
$U = array();
$XIn[0] = 0;
$YIn[0] = 0;

Expand All @@ -1679,7 +1680,7 @@ function drawCubicCurve($Data, $DataDescription, $Accuracy = .1, $SerieName = ""

$Index = 1;
$XLast = -1;
$Missing = "";
$Missing = array();
foreach ($Data as $Key => $Values) {
if (isset($Data[$Key][$ColName])) {
$Value = $Data[$Key][$ColName];
Expand Down Expand Up @@ -1768,10 +1769,10 @@ function drawFilledCubicCurve($Data, $DataDescription, $Accuracy = .1, $Alpha =

$GraphID = 0;
foreach ($DataDescription["Values"] as $Key2 => $ColName) {
$XIn = "";
$Yin = "";
$Yt = "";
$U = "";
$XIn = array();
$Yin = array();
$Yt = array();
$U = array();
$XIn[0] = 0;
$YIn[0] = 0;

Expand All @@ -1785,7 +1786,7 @@ function drawFilledCubicCurve($Data, $DataDescription, $Accuracy = .1, $Alpha =

$Index = 1;
$XLast = -1;
$Missing = "";
$Missing = array();
foreach ($Data as $Key => $Values) {
$Value = $Data[$Key][$ColName];
$XIn[$Index] = $Index;
Expand Down Expand Up @@ -1815,7 +1816,7 @@ function drawFilledCubicCurve($Data, $DataDescription, $Accuracy = .1, $Alpha =
for ($k = $Index - 1; $k >= 1; $k--)
$Yt[$k] = $Yt[$k] * $Yt[$k + 1] + $U[$k];

$Points = "";
$Points = array();
$Points[] = $this->GAreaXOffset;
$Points[] = $LayerHeight;

Expand Down Expand Up @@ -1848,7 +1849,7 @@ function drawFilledCubicCurve($Data, $DataDescription, $Accuracy = .1, $Alpha =
$YPos = $LayerHeight - (($Value - $this->VMin) * $this->DivisionRatio);

if ($YLast != NULL && $AroundZero && !isset($Missing[floor($X)]) && !isset($Missing[floor($X + 1)])) {
$aPoints = "";
$aPoints = array();
$aPoints[] = $XLast;
$aPoints[] = $YLast;
$aPoints[] = $XPos;
Expand Down Expand Up @@ -1883,7 +1884,7 @@ function drawFilledCubicCurve($Data, $DataDescription, $Accuracy = .1, $Alpha =
$YPos = $LayerHeight - (($YIn[$Index] - $this->VMin) * $this->DivisionRatio);

if ($YLast != NULL && $AroundZero) {
$aPoints = "";
$aPoints = array();
$aPoints[] = $XLast;
$aPoints[] = $YLast;
$aPoints[] = $LayerWidth - $this->GAreaXOffset;
Expand Down Expand Up @@ -1943,7 +1944,7 @@ function drawFilledLineGraph($Data, $DataDescription, $Alpha = 100, $AroundZero
$ID++;
}

$aPoints = "";
$aPoints = array();
$aPoints[] = $this->GAreaXOffset;
$aPoints[] = $LayerHeight;

Expand Down Expand Up @@ -1989,7 +1990,7 @@ function drawFilledLineGraph($Data, $DataDescription, $Alpha = 100, $AroundZero
}

if ($YLast <> $Empty && $AroundZero) {
$Points = "";
$Points = array();
$Points[] = $XLast;
$Points[] = $YLast;
$Points[] = $XPos;
Expand Down Expand Up @@ -2164,7 +2165,7 @@ function drawStackedBarGraph($Data, $DataDescription, $Alpha = 50, $Contiguous =
}

$SerieID = 0;
$LastValue = "";
$LastValue = array();
foreach ($DataDescription["Values"] as $Key2 => $ColName) {
$ID = 0;
foreach ($DataDescription["Description"] as $keyI => $ValueI) {
Expand Down Expand Up @@ -2301,7 +2302,7 @@ function drawRadarAxis($Data, $DataDescription, $Mosaic = TRUE, $BorderOffset =
$Y2 = sin($Angle * 3.1418 / 180) * ($TRadius + $RadiusScale) + $YCenter;

if ($t % 2 == 1 && $LastX1 != -1) {
$Plots = "";
$Plots = array();
$Plots[] = $X1;
$Plots[] = $Y1;
$Plots[] = $X2;
Expand Down Expand Up @@ -2498,7 +2499,7 @@ function drawFilledRadar($Data, $DataDescription, $Alpha = 50, $BorderOffset = 1

$Angle = -90;
$XLast = -1;
$Plots = "";
$Plots = array();
foreach ($Data as $Key => $Values) {
if (isset($Data[$Key][$ColName])) {
$Value = $Data[$Key][$ColName];
Expand Down Expand Up @@ -2573,7 +2574,7 @@ function drawBasicPieGraph($Data, $DataDescription, $XPos, $YPos, $Radius = 100,

/* Calculate all polygons */
$Angle = 0;
$TopPlots = "";
$TopPlots = array();
foreach ($iValues as $Key => $Value) {
$TopPlots[$Key][] = $XPos;
$TopPlots[$Key][] = $YPos;
Expand Down Expand Up @@ -2690,7 +2691,7 @@ function drawFlatPieGraph($Data, $DataDescription, $XPos, $YPos, $Radius = 100,

/* Calculate all polygons */
$Angle = 0;
$TopPlots = "";
$TopPlots = array();
foreach ($iValues as $Key => $Value) {
$XOffset = cos(($Angle + ($Value / 2 * $SpliceRatio)) * 3.1418 / 180) * $SpliceDistance;
$YOffset = sin(($Angle + ($Value / 2 * $SpliceRatio)) * 3.1418 / 180) * $SpliceDistance;
Expand All @@ -2708,8 +2709,8 @@ function drawFlatPieGraph($Data, $DataDescription, $XPos, $YPos, $Radius = 100,
$Bc = $this->Palette[$Key]["B"];
}

$XLineLast = "";
$YLineLast = "";
$XLineLast = 0;
$YLineLast = 0;

/* Process labels position & size */
$Caption = "";
Expand Down Expand Up @@ -2748,8 +2749,8 @@ function drawFlatPieGraph($Data, $DataDescription, $XPos, $YPos, $Radius = 100,
else
$LineColor = $this->AllocateColor($this->Picture, $Rc, $Gc, $Bc);

$XLineLast = "";
$YLineLast = "";
$XLineLast = 0;
$YLineLast = 0;
for ($iAngle = $Angle; $iAngle <= $Angle + $Value * $SpliceRatio; $iAngle = $iAngle + .5) {
$PosX = cos($iAngle * 3.1418 / 180) * $Radius + $XPos + $XOffset;
$PosY = sin($iAngle * 3.1418 / 180) * $Radius + $YPos + $YOffset;
Expand Down Expand Up @@ -2831,10 +2832,10 @@ function drawPieGraph($Data, $DataDescription, $XPos, $YPos, $Radius = 100, $Dra
/* Calculate all polygons */
$Angle = 0;
$CDev = 5;
$TopPlots = "";
$BotPlots = "";
$aTopPlots = "";
$aBotPlots = "";
$TopPlots = array();
$BotPlots = array();
$aTopPlots = array();
$aBotPlots = array();
foreach ($iValues as $Key => $Value) {
$XCenterPos = cos(($Angle - $CDev + ($Value * $SpliceRatio + $SpliceDistanceRatio) / 2) * 3.1418 / 180) * $SpliceDistance + $XPos;
$YCenterPos = sin(($Angle - $CDev + ($Value * $SpliceRatio + $SpliceDistanceRatio) / 2) * 3.1418 / 180) * $SpliceDistance + $YPos;
Expand Down Expand Up @@ -2930,7 +2931,7 @@ function drawPieGraph($Data, $DataDescription, $XPos, $YPos, $Radius = 100, $Dra
for ($i = $SpliceHeight - 1; $i >= 1; $i--) {
foreach ($iValues as $Key => $Value) {
$C_GraphLo = $this->AllocateColor($this->Picture, $this->Palette[$Key]["R"], $this->Palette[$Key]["G"], $this->Palette[$Key]["B"], -10);
$Plots = "";
$Plots = array();
$Plot = 0;
foreach ($TopPlots[$Key] as $Key2 => $Value2) {
$Plot++;
Expand Down Expand Up @@ -3672,7 +3673,7 @@ function drawAntialiasPixel($X, $Y, $R, $G, $B, $Alpha = 100, $NoFallBack = FALS
$B = 255;
}

$Plot = "";
$Plot = array();
$Xi = floor($X);
$Yi = floor($Y);

Expand Down
7 changes: 4 additions & 3 deletions src/pChart/pData.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,16 @@
namespace pChart;

/* pData class definition */

class pData
{
var $Data;
var $DataDescription;

function pData()
{
$this->Data = "";
$this->DataDescription = "";
$this->Data = array();
$this->DataDescription = array();
$this->DataDescription["Position"] = "Name";
$this->DataDescription["Format"]["X"] = "number";
$this->DataDescription["Format"]["Y"] = "number";
Expand All @@ -72,7 +73,7 @@ function ImportFromCSV($FileName, $Delimiter = ",", $DataColumns = -1, $HasHeade
$buffer = fgets($handle, 4096);
$buffer = str_replace(chr(10), "", $buffer);
$buffer = str_replace(chr(13), "", $buffer);
$Values = split($Delimiter, $buffer);
$Values = explode($Delimiter, $buffer);

if ($buffer != "") {
if ($HasHeader == TRUE && $HeaderParsed == FALSE) {
Expand Down

0 comments on commit 68a4d26

Please sign in to comment.