This commit is contained in:
Namhyeon Go 2019-04-12 07:54:37 +00:00
parent ef6339c7c6
commit 54bb47deee
54 changed files with 27 additions and 5439 deletions

View File

@ -5,7 +5,7 @@
* @author Go Namhyeon <gnh1201@gmail.com>
* @brief HybridAuth DB Helper
*/
if(!check_function_exists("store_hybridauth_session")) {
function store_hybridauth_session($data, $user_id) {
$connection_id = false;
@ -60,7 +60,7 @@ if(!check_function_exists("get_hybridauth_connection_info")) {
if(!check_function_exists("get_hybridauth_connection_id")) {
function get_hybridauth_connection_id($user_id) {
$connection_id = false;
$bind = array(
"user_id" => $user_id
);

View File

@ -1,4 +0,0 @@
<?php
include_once("./vendor/pChart/pChart/pData.class");
include_once("./vendor/pChart/pChart/pChart.class");

5
helper/pChart2.lnk.php Normal file
View File

@ -0,0 +1,5 @@
<?php
loadVender("pChart2/");

View File

@ -29,15 +29,15 @@ return array(
"Google" => array(
"enabled" => true,
"keys" => array(
"id" => get_value_in_array("sns_google_id", $config, ""),
"secret" => get_value_in_array("sns_google_secret", $config, ""),
"id" => get_value_in_array("social_google_id", $config, ""),
"secret" => get_value_in_array("social_google_secret", $config, ""),
),
),
"Facebook" => array(
"enabled" => true,
"keys" => array(
"id" => get_value_in_array("sns_facebook_id", $config, ""),
"secret" => get_value_in_array("sns_facebook_secret", $config, ""),
"id" => get_value_in_array("social_facebook_id", $config, ""),
"secret" => get_value_in_array("social_facebook_secret", $config, ""),
),
"trustForwarded" => false,
"scope" => array("email", "public_profile"),
@ -45,8 +45,8 @@ return array(
"Twitter" => array(
"enabled" => true,
"keys" => array(
"key" => get_value_in_array("sns_twitter_key", $config, ""),
"secret" => get_value_in_array("sns_twitter_secret", $config, ""),
"key" => get_value_in_array("social_twitter_key", $config, ""),
"secret" => get_value_in_array("social_twitter_secret", $config, ""),
),
"includeEmail" => false,
),
@ -58,8 +58,8 @@ return array(
"LinkedIn" => array(
"enabled" => true,
"keys" => array(
"id" => get_value_in_array("sns_linkedin_id", $config, ""),
"secret" => get_value_in_array("sns_linkedin_secret", $config, ""),
"id" => get_value_in_array("social_linkedin_id", $config, ""),
"secret" => get_value_in_array("social_linkedin_secret", $config, ""),
),
"fields" => array(),
),

View File

@ -1,12 +0,0 @@
<?php
return <<<EOF
[sns]
sns_facebook_id=
sns_facebook_secret=
sns_twitter_key=
sns_twitter_secret=
sns_linkedin_id=
sns_linkedin_secret=
sns_google_id=
sns_google_secret=
EOF;

View File

@ -0,0 +1,12 @@
<?php
return <<<EOF
[social]
social_facebook_id=
social_facebook_secret=
social_twitter_key=
social_twitter_secret=
social_linkedin_id=
social_linkedin_secret=
soclai_google_id=
social_google_secret=
EOF;

View File

@ -1,45 +0,0 @@
<?php
/*
Example1 : A simple line chart
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->ImportFromCSV("Sample/bulkdata.csv",",",array(1,2,3),FALSE,0);
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie();
$DataSet->SetSerieName("January","Serie1");
$DataSet->SetSerieName("February","Serie2");
$DataSet->SetSerieName("March","Serie3");
$DataSet->SetYAxisName("Average age");
$DataSet->SetYAxisUnit("µs");
// Initialise the graph
$Test = new pChart(700,230);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(70,30,680,200);
$Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
$Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2);
$Test->drawGrid(4,TRUE,230,230,230,50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf",6);
$Test->drawTreshold(0,143,55,72,TRUE,TRUE);
// Draw the line graph
$Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());
$Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(75,35,$DataSet->GetDataDescription(),255,255,255);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(60,22,"example 1",50,50,50,585);
$Test->Render("example1.png");
?>

View File

@ -1,34 +0,0 @@
<?php
/*
Example10 : A 3D exploded pie graph
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(10,2,3,5,3),"Serie1");
$DataSet->AddPoint(array("January","February","March","April","May"),"Serie2");
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie("Serie2");
// Initialise the graph
$Test = new pChart(420,250);
$Test->drawFilledRoundedRectangle(7,7,413,243,5,240,240,240);
$Test->drawRoundedRectangle(5,5,415,245,5,230,230,230);
$Test->createColorGradientPalette(195,204,56,223,110,41,5);
// Draw the pie chart
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->AntialiasQuality = 0;
$Test->drawPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),180,130,110,PIE_PERCENTAGE_LABEL,FALSE,50,20,5);
$Test->drawPieLegend(330,15,$DataSet->GetData(),$DataSet->GetDataDescription(),250,250,250);
// Write the title
$Test->setFontProperties("Fonts/MankSans.ttf",10);
$Test->drawTitle(10,20,"Sales per month",100,100,100);
$Test->Render("example10.png");
?>

View File

@ -1,50 +0,0 @@
<?php
/*
Example11 : Using the pCache class
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
include("pChart/pCache.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(1,4,3,2,3,3,2,1,0,7,4,3,2,3,3,5,1,0,7),"Serie1");
$DataSet->AddPoint(array(1,4,2,6,2,3,0,1,5,1,2,4,5,2,1,0,6,4,2),"Serie2");
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie();
$DataSet->SetSerieName("January","Serie1");
$DataSet->SetSerieName("February","Serie2");
// Cache definition
$Cache = new pCache();
$Cache->GetFromCache("Graph1",$DataSet->GetData());
// Initialise the graph
$Test = new pChart(700,230);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(50,30,585,200);
$Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
$Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2);
$Test->drawGrid(4,TRUE,230,230,230,50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf",6);
$Test->drawTreshold(0,143,55,72,TRUE,TRUE);
// Draw the cubic curve graph
$Test->drawCubicCurve($DataSet->GetData(),$DataSet->GetDataDescription());
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(600,30,$DataSet->GetDataDescription(),255,255,255);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(50,22,"Example 1",50,50,50,585);
// Render the graph
$Cache->WriteToCache("Graph1",$DataSet->GetData(),$Test);
$Test->Render("example1.png");
?>

View File

@ -1,45 +0,0 @@
<?php
/*
Example12 : A true bar graph
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(1,4,-3,2,-3,3,2,1,0,7,4),"Serie1");
$DataSet->AddPoint(array(3,3,-4,1,-2,2,1,0,-1,6,3),"Serie2");
$DataSet->AddPoint(array(4,1,2,-1,-4,-2,3,2,1,2,2),"Serie3");
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie();
$DataSet->SetSerieName("January","Serie1");
$DataSet->SetSerieName("February","Serie2");
$DataSet->SetSerieName("March","Serie3");
// Initialise the graph
$Test = new pChart(700,230);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(50,30,680,200);
$Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
$Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE);
$Test->drawGrid(4,TRUE,230,230,230,50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf",6);
$Test->drawTreshold(0,143,55,72,TRUE,TRUE);
// Draw the bar graph
$Test->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE,80);
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(596,150,$DataSet->GetDataDescription(),255,255,255);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(50,22,"Example 12",50,50,50,585);
$Test->Render("example12.png");
?>

View File

@ -1,32 +0,0 @@
<?php
/*
Example13: A 2D exploded pie graph
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(10,2,3,5,3),"Serie1");
$DataSet->AddPoint(array("Jan","Feb","Mar","Apr","May"),"Serie2");
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie("Serie2");
// Initialise the graph
$Test = new pChart(300,200);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawFilledRoundedRectangle(7,7,293,193,5,240,240,240);
$Test->drawRoundedRectangle(5,5,295,195,5,230,230,230);
// Draw the pie chart
$Test->AntialiasQuality = 0;
$Test->setShadowProperties(2,2,200,200,200);
$Test->drawFlatPieGraphWithShadow($DataSet->GetData(),$DataSet->GetDataDescription(),120,100,60,PIE_PERCENTAGE,8);
$Test->clearShadow();
$Test->drawPieLegend(230,15,$DataSet->GetData(),$DataSet->GetDataDescription(),250,250,250);
$Test->Render("example13.png");
?>

View File

@ -1,33 +0,0 @@
<?php
/*
Example14: A smooth flat pie graph
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(10,2,3,5,3),"Serie1");
$DataSet->AddPoint(array("Jan","Feb","Mar","Apr","May"),"Serie2");
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie("Serie2");
// Initialise the graph
$Test = new pChart(300,200);
$Test->loadColorPalette("Sample/softtones.txt");
$Test->drawFilledRoundedRectangle(7,7,293,193,5,240,240,240);
$Test->drawRoundedRectangle(5,5,295,195,5,230,230,230);
// This will draw a shadow under the pie chart
$Test->drawFilledCircle(122,102,70,200,200,200);
// Draw the pie chart
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->AntialiasQuality = 0;
$Test->drawBasicPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),120,100,70,PIE_PERCENTAGE,255,255,218);
$Test->drawPieLegend(230,15,$DataSet->GetData(),$DataSet->GetDataDescription(),250,250,250);
$Test->Render("example14.png");
?>

View File

@ -1,68 +0,0 @@
<?php
/*
Example15 : Playing with line style & pictures inclusion
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(10,9.4,7.7,5,1.7,-1.7,-5,-7.7,-9.4,-10,-9.4,-7.7,-5,-1.8,1.7),"Serie1");
$DataSet->AddPoint(array(0,3.4,6.4,8.7,9.8,9.8,8.7,6.4,3.4,0,-3.4,-6.4,-8.6,-9.8,-9.9),"Serie2");
$DataSet->AddPoint(array(7.1,9.1,10,9.7,8.2,5.7,2.6,-0.9,-4.2,-7.1,-9.1,-10,-9.7,-8.2,-5.8),"Serie3");
$DataSet->AddPoint(array("Jan","Jan","Jan","Feb","Feb","Feb","Mar","Mar","Mar","Apr","Apr","Apr","May","May","May"),"Serie4");
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie("Serie4");
$DataSet->SetSerieName("Max Average","Serie1");
$DataSet->SetSerieName("Min Average","Serie2");
$DataSet->SetSerieName("Temperature","Serie3");
$DataSet->SetYAxisName("Temperature");
$DataSet->SetXAxisName("Month of the year");
// Initialise the graph
$Test = new pChart(700,230);
$Test->reportWarnings("GD");
$Test->setFixedScale(-12,12,5);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(65,30,570,185);
$Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
$Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE,3);
$Test->drawGrid(4,TRUE,230,230,230,50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf",6);
$Test->drawTreshold(0,143,55,72,TRUE,TRUE);
// Draw the area
$DataSet->RemoveSerie("Serie4");
$Test->drawArea($DataSet->GetData(),"Serie1","Serie2",239,238,227,50);
$DataSet->RemoveSerie("Serie3");
$Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());
// Draw the line graph
$Test->setLineStyle(1,6);
$DataSet->RemoveAllSeries();
$DataSet->AddSerie("Serie3");
$Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());
$Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);
// Write values on Serie3
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->writeValues($DataSet->GetData(),$DataSet->GetDataDescription(),"Serie3");
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(590,90,$DataSet->GetDataDescription(),255,255,255);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(60,22,"example 15",50,50,50,585);
// Add an image
$Test->drawFromPNG("Sample/logo.png",584,35);
// Render the chart
$Test->Render("example15.png");
?>

View File

@ -1,42 +0,0 @@
<?php
/*
Example16 : Importing CSV data
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->ImportFromCSV("Sample/CO2.csv",",",array(1,2,3,4),TRUE,0);
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie();
$DataSet->SetYAxisName("CO2 concentrations");
// Initialise the graph
$Test = new pChart(700,230);
$Test->reportWarnings("GD");
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(60,30,680,180);
$Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
$Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,90,2);
$Test->drawGrid(4,TRUE,230,230,230,50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf",6);
$Test->drawTreshold(0,143,55,72,TRUE,TRUE);
// Draw the line graph
$Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());
$Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(70,40,$DataSet->GetDataDescription(),255,255,255);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(60,22,"CO2 concentrations at Mauna Loa",50,50,50,585);
$Test->Render("example16.png");
?>

View File

@ -1,48 +0,0 @@
<?php
/*
Example17 : Playing with axis
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(100,320,200,10,43),"Serie1");
$DataSet->AddPoint(array(23,432,43,153,234),"Serie2");
$DataSet->AddPoint(array(1217541600,1217628000,1217714400,1217800800,1217887200),"Serie3");
$DataSet->AddSerie("Serie1");
$DataSet->AddSerie("Serie2");
$DataSet->SetAbsciseLabelSerie("Serie3");
$DataSet->SetSerieName("Incoming","Serie1");
$DataSet->SetSerieName("Outgoing","Serie2");
$DataSet->SetYAxisName("Call duration");
$DataSet->SetYAxisFormat("time");
$DataSet->SetXAxisFormat("date");
// Initialise the graph
$Test = new pChart(700,230);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(85,30,650,200);
$Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
$Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2);
$Test->drawGrid(4,TRUE,230,230,230,50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf",6);
$Test->drawTreshold(0,143,55,72,TRUE,TRUE);
// Draw the line graph
$Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());
$Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(90,35,$DataSet->GetDataDescription(),255,255,255);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(60,22,"example 17",50,50,50,585);
$Test->Render("example17.png");
?>

View File

@ -1,55 +0,0 @@
<?php
/*
Example18 : Missing values
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(2,5,7,"","",5,6,4,8,4,"",2,5,6,4,5,6,7,6),"Serie1");
$DataSet->AddPoint(array(-1,-3,-1,-2,-4,-1,"",-4,-5,-3,-2,-2,-3,-3,-5,-4,-3,-1,""),"Serie2");
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie();
$DataSet->SetSerieName("Raw #1","Serie1");
$DataSet->SetSerieName("Raw #2","Serie2");
$DataSet->SetYAxisName("Response time");
$DataSet->SetXAxisName("Sample #ID");
//print_r($DataSet->GetData());
// Initialise the graph
$Test = new pChart(700,230);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(55,30,585,185);
$Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
$Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE);
$Test->drawGrid(4,TRUE,230,230,230,50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf",6);
$Test->drawTreshold(0,143,55,72,TRUE,TRUE);
// Draw the line graph
$DataSet->RemoveSerie("Serie2");
$Test->drawFilledLineGraph($DataSet->GetData(),$DataSet->GetDataDescription(),60,TRUE);
// Draw the curve graph
$DataSet->RemoveSerie("Serie1");
$DataSet->AddSerie("Serie2");
$Test->setShadowProperties(2,2,200,200,200,50);
$Test->drawCubicCurve($DataSet->GetData(),$DataSet->GetDataDescription());
$Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);
$Test->clearShadow();
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(600,30,$DataSet->GetDataDescription(),255,255,255);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(50,22,"Example 18",50,50,50,585);
$Test->Render("example18.png");
?>

View File

@ -1,44 +0,0 @@
<?php
/*
Example19 : Error reporting
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(10,4,3,2,3,3,2,1,0,7,4,3,2,3,3,5,1,0,7),"Serie1");
$DataSet->AddPoint(array(1,4,2,6,2,3,0,1,-5,1,2,4,5,2,1,0,6,4,30),"Serie2");
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie();
$DataSet->SetXAxisName("Samples");
$DataSet->SetYAxisName("Temperature");
$DataSet->SetSerieName("January","Serie1");
// Initialise the graph
$Test = new pChart(700,230);
$Test->reportWarnings("GD");
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(60,30,585,185);
$Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
$Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2);
$Test->drawGrid(4,TRUE,230,230,230,50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf",6);
$Test->drawTreshold(0,143,55,72,TRUE,TRUE);
// Draw the cubic curve graph
$Test->drawCubicCurve($DataSet->GetData(),$DataSet->GetDataDescription());
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(600,30,$DataSet->GetDataDescription(),255,255,255);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(50,22,"Example 19",50,50,50,585);
$Test->Render("example19.png");
?>

View File

@ -1,43 +0,0 @@
<?php
/*
Example2 : A cubic curve graph
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(1,4,3,4,3,3,2,1,0,7,4,3,2,3,3,5,1,0,7),"Serie1");
$DataSet->AddPoint(array(1,4,2,6,2,3,0,1,5,1,2,4,5,2,1,0,6,4,2),"Serie2");
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie();
$DataSet->SetSerieName("January","Serie1");
$DataSet->SetSerieName("February","Serie2");
// Initialise the graph
$Test = new pChart(700,230);
$Test->setFixedScale(-2,8);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(50,30,585,200);
$Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
$Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2);
$Test->drawGrid(4,TRUE,230,230,230,50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf",6);
$Test->drawTreshold(0,143,55,72,TRUE,TRUE);
// Draw the cubic curve graph
$Test->drawCubicCurve($DataSet->GetData(),$DataSet->GetDataDescription());
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(600,30,$DataSet->GetDataDescription(),255,255,255);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(50,22,"Example 2",50,50,50,585);
$Test->Render("example2.png");
?>

View File

@ -1,44 +0,0 @@
<?php
/*
Example20 : A stacked bar graph
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(1,4,-3,2,-3,3,2,1,0,7,4),"Serie1");
$DataSet->AddPoint(array(3,3,-4,1,-2,2,1,0,-1,6,3),"Serie2");
$DataSet->AddPoint(array(4,1,2,-1,-4,-2,3,2,1,2,2),"Serie3");
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie();
$DataSet->SetSerieName("January","Serie1");
$DataSet->SetSerieName("February","Serie2");
$DataSet->SetSerieName("March","Serie3");
// Initialise the graph
$Test = new pChart(700,230);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(50,30,680,200);
$Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
$Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_ADDALL,150,150,150,TRUE,0,2,TRUE);
$Test->drawGrid(4,TRUE,230,230,230,50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf",6);
$Test->drawTreshold(0,143,55,72,TRUE,TRUE);
// Draw the bar graph
$Test->drawStackedBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),100);
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(596,150,$DataSet->GetDataDescription(),255,255,255);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(50,22,"Example 20",50,50,50,585);
$Test->Render("example20.png");
?>

View File

@ -1,53 +0,0 @@
<?php
/*
Example21 : Playing with background
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(9,9,9,10,10,11,12,14,16,17,18,18,19,19,18,15,12,10,9),"Serie1");
$DataSet->AddPoint(array(10,11,11,12,12,13,14,15,17,19,22,24,23,23,22,20,18,16,14),"Serie2");
$DataSet->AddPoint(array(4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22),"Serie3");
$DataSet->AddAllSeries();
$DataSet->RemoveSerie("Serie3");
$DataSet->SetAbsciseLabelSerie("Serie3");
$DataSet->SetSerieName("January","Serie1");
$DataSet->SetSerieName("February","Serie2");
$DataSet->SetYAxisName("Temperature");
$DataSet->SetYAxisUnit("°C");
$DataSet->SetXAxisUnit("h");
// Initialise the graph
$Test = new pChart(700,230);
$Test->drawGraphAreaGradient(132,153,172,50,TARGET_BACKGROUND);
// Graph area setup
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(60,20,585,180);
$Test->drawGraphArea(213,217,221,FALSE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,213,217,221,TRUE,0,2);
$Test->drawGraphAreaGradient(162,183,202,50);
$Test->drawGrid(4,TRUE,230,230,230,20);
// Draw the line chart
$Test->setShadowProperties(3,3,0,0,0,30,4);
$Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());
$Test->clearShadow();
$Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),4,2,-1,-1,-1,TRUE);
// Draw the legend
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(605,142,$DataSet->GetDataDescription(),236,238,240,52,58,82);
// Draw the title
$Title = "Average Temperatures during the first months of 2008 ";
$Test->drawTextBox(0,210,700,230,$Title,0,255,255,255,ALIGN_RIGHT,TRUE,0,0,0,30);
// Render the picture
$Test->addBorder(2);
$Test->Render("example21.png");
?>

View File

@ -1,50 +0,0 @@
<?php
/*
Example22 : Customizing plot graphs
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(60,70,90,110,100,90),"Serie1");
$DataSet->AddPoint(array(40,50,60,80,70,60),"Serie2");
$DataSet->AddPoint(array("Jan","Feb","Mar","Apr","May","Jun"),"Serie3");
$DataSet->AddSerie("Serie1");
$DataSet->AddSerie("Serie2");
$DataSet->SetAbsciseLabelSerie("Serie3");
$DataSet->SetSerieName("Company A","Serie1");
$DataSet->SetSerieName("Company B","Serie2");
$DataSet->SetYAxisName("Product sales");
$DataSet->SetYAxisUnit("k");
$DataSet->SetSerieSymbol("Serie1","Sample/Point_Asterisk.gif");
$DataSet->SetSerieSymbol("Serie2","Sample/Point_Cd.gif");
// Initialise the graph
$Test = new pChart(700,230);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(65,30,650,200);
$Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
$Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE);
$Test->drawGrid(4,TRUE,230,230,230,50);
// Draw the title
$Test->setFontProperties("Fonts/pf_arma_five.ttf",6);
$Title = "Comparative product sales for company A & B ";
$Test->drawTextBox(65,30,650,45,$Title,0,255,255,255,ALIGN_RIGHT,TRUE,0,0,0,30);
// Draw the line graph
$Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());
$Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);
// Draw the legend
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(80,60,$DataSet->GetDataDescription(),255,255,255);
// Render the chart
$Test->Render("example22.png");
?>

View File

@ -1,49 +0,0 @@
<?php
/*
Example23 : Playing with background bis
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(9,9,9,10,10,11,12,14,16,17,18,18,19,19,18,15,12,10,9),"Serie1");
$DataSet->AddPoint(array(10,11,11,12,12,13,14,15,17,19,22,24,23,23,22,20,18,16,14),"Serie2");
$DataSet->AddPoint(array(4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22),"Serie3");
$DataSet->AddAllSeries();
$DataSet->RemoveSerie("Serie3");
$DataSet->SetAbsciseLabelSerie("Serie3");
$DataSet->SetSerieName("January","Serie1");
$DataSet->SetSerieName("February","Serie2");
$DataSet->SetYAxisName("Temperature");
$DataSet->SetYAxisUnit("°C");
$DataSet->SetXAxisUnit("h");
// Initialise the graph
$Test = new pChart(700,230);
$Test->drawGraphAreaGradient(132,173,131,50,TARGET_BACKGROUND);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(120,20,675,190);
$Test->drawGraphArea(213,217,221,FALSE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_ADDALL,213,217,221,TRUE,0,2,TRUE);
$Test->drawGraphAreaGradient(163,203,167,50);
$Test->drawGrid(4,TRUE,230,230,230,20);
// Draw the bar chart
$Test->drawStackedBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),70);
// Draw the title
$Title = " Average Temperatures during\r\n the first months of 2008 ";
$Test->drawTextBox(0,0,50,230,$Title,90,255,255,255,ALIGN_BOTTOM_CENTER,TRUE,0,0,0,30);
// Draw the legend
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(610,10,$DataSet->GetDataDescription(),236,238,240,52,58,82);
// Render the picture
$Test->addBorder(2);
$Test->Render("example23.png");
?>

View File

@ -1,53 +0,0 @@
<?php
/*
Example24 : X versus Y chart
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
// Compute the points
for($i=0;$i<=360;$i=$i+10)
{
$DataSet->AddPoint(cos($i*3.14/180)*80+$i,"Serie1");
$DataSet->AddPoint(sin($i*3.14/180)*80+$i,"Serie2");
}
$DataSet->SetSerieName("Trigonometric function","Serie1");
$DataSet->AddSerie("Serie1");
$DataSet->AddSerie("Serie2");
$DataSet->SetXAxisName("X Axis");
$DataSet->SetYAxisName("Y Axis");
// Initialise the graph
$Test = new pChart(300,300);
$Test->drawGraphAreaGradient(0,0,0,-100,TARGET_BACKGROUND);
// Prepare the graph area
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(55,30,270,230);
$Test->drawXYScale($DataSet->GetData(),$DataSet->GetDataDescription(),"Serie1","Serie2",213,217,221,TRUE,45);
$Test->drawGraphArea(213,217,221,FALSE);
$Test->drawGraphAreaGradient(30,30,30,-50);
$Test->drawGrid(4,TRUE,230,230,230,20);
// Draw the chart
$Test->setShadowProperties(2,2,0,0,0,60,4);
$Test->drawXYGraph($DataSet->GetData(),$DataSet->GetDataDescription(),"Serie1","Serie2",0);
$Test->clearShadow();
// Draw the title
$Title = "Drawing X versus Y charts trigonometric functions ";
$Test->drawTextBox(0,280,300,300,$Title,0,255,255,255,ALIGN_RIGHT,TRUE,0,0,0,30);
// Draw the legend
$Test->setFontProperties("Fonts/pf_arma_five.ttf",6);
$DataSet->RemoveSerie("Serie2");
$Test->drawLegend(160,5,$DataSet->GetDataDescription(),0,0,0,0,0,0,255,255,255,FALSE);
$Test->Render("example24.png");
?>

View File

@ -1,55 +0,0 @@
<?php
/*
Example25 : Playing with shadow
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(9,9,9,10,10,11,12,14,16,17,18,18,19,19,18,15,12,10,9),"Serie1");
$DataSet->AddPoint(array(10,11,11,12,12,13,14,15,17,19,22,24,23,23,22,20,18,16,14),"Serie2");
$DataSet->AddPoint(array(4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22),"Serie3");
$DataSet->AddAllSeries();
$DataSet->RemoveSerie("Serie3");
$DataSet->SetAbsciseLabelSerie("Serie3");
$DataSet->SetSerieName("January","Serie1");
$DataSet->SetSerieName("February","Serie2");
$DataSet->SetYAxisName("Temperature");
$DataSet->SetYAxisUnit("°C");
$DataSet->SetXAxisUnit("h");
// Initialise the graph
$Test = new pChart(700,230);
$Test->drawGraphAreaGradient(90,90,90,90,TARGET_BACKGROUND);
$Test->setFixedScale(0,40,4);
// Graph area setup
$Test->setFontProperties("Fonts/pf_arma_five.ttf",6);
$Test->setGraphArea(60,40,680,200);
$Test->drawGraphArea(200,200,200,FALSE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,200,200,200,TRUE,0,2);
$Test->drawGraphAreaGradient(40,40,40,-50);
$Test->drawGrid(4,TRUE,230,230,230,10);
// Draw the line chart
$Test->setShadowProperties(3,3,0,0,0,30,4);
$Test->drawCubicCurve($DataSet->GetData(),$DataSet->GetDataDescription());
$Test->clearShadow();
$Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,0,-1,-1,-1,TRUE);
// Write the title
$Test->setFontProperties("Fonts/MankSans.ttf",18);
$Test->setShadowProperties(1,1,0,0,0);
$Test->drawTitle(0,0,"Average temperatures",255,255,255,700,30,TRUE);
$Test->clearShadow();
// Draw the legend
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(610,5,$DataSet->GetDataDescription(),0,0,0,0,0,0,255,255,255,FALSE);
// Render the picture
$Test->Render("example25.png");
?>

View File

@ -1,69 +0,0 @@
<?php
/*
Example26 : Two Y axis / shadow demonstration
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(110,101,118,108,110,106,104),"Serie1");
$DataSet->AddPoint(array(700,2705,2041,1712,2051,846,903),"Serie2");
$DataSet->AddPoint(array("03 Oct","02 Oct","01 Oct","30 Sep","29 Sep","28 Sep","27 Sep"),"Serie3");
$DataSet->AddSerie("Serie1");
$DataSet->SetAbsciseLabelSerie("Serie3");
$DataSet->SetSerieName("SourceForge Rank","Serie1");
$DataSet->SetSerieName("Web Hits","Serie2");
// Initialise the graph
$Test = new pChart(660,230);
$Test->drawGraphAreaGradient(90,90,90,90,TARGET_BACKGROUND);
// Prepare the graph area
$Test->setFontProperties("fonts/tahoma.ttf",8);
$Test->setGraphArea(60,40,595,190);
// Initialise graph area
$Test->setFontProperties("fonts/tahoma.ttf",8);
// Draw the SourceForge Rank graph
$DataSet->SetYAxisName("Sourceforge Rank");
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,213,217,221,TRUE,0,0);
$Test->drawGraphAreaGradient(40,40,40,-50);
$Test->drawGrid(4,TRUE,230,230,230,10);
$Test->setShadowProperties(3,3,0,0,0,30,4);
$Test->drawCubicCurve($DataSet->GetData(),$DataSet->GetDataDescription());
$Test->clearShadow();
$Test->drawFilledCubicCurve($DataSet->GetData(),$DataSet->GetDataDescription(),.1,30);
$Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);
// Clear the scale
$Test->clearScale();
// Draw the 2nd graph
$DataSet->RemoveSerie("Serie1");
$DataSet->AddSerie("Serie2");
$DataSet->SetYAxisName("Web Hits");
$Test->drawRightScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,213,217,221,TRUE,0,0);
$Test->drawGrid(4,TRUE,230,230,230,10);
$Test->setShadowProperties(3,3,0,0,0,30,4);
$Test->drawCubicCurve($DataSet->GetData(),$DataSet->GetDataDescription());
$Test->clearShadow();
$Test->drawFilledCubicCurve($DataSet->GetData(),$DataSet->GetDataDescription(),.1,30);
$Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);
// Write the legend (box less)
$Test->setFontProperties("fonts/tahoma.ttf",8);
$Test->drawLegend(530,5,$DataSet->GetDataDescription(),0,0,0,0,0,0,255,255,255,FALSE);
// Write the title
$Test->setFontProperties("fonts/MankSans.ttf",18);
$Test->setShadowProperties(1,1,0,0,0);
$Test->drawTitle(0,0,"SourceForge ranking summary",255,255,255,660,30,TRUE);
$Test->clearShadow();
// Render the picture
$Test->Render("example26.png");
?>

View File

@ -1,42 +0,0 @@
<?php
/*
Example3 : an overlayed bar graph, uggly no?
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(1,4,-3,2,-3,3,2,1,0,7,4,-3,2,-3,3,5,1,0,7),"Serie1");
$DataSet->AddPoint(array(0,3,-4,1,-2,2,1,0,-1,6,3,-4,1,-4,2,4,0,-1,6),"Serie2");
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie();
$DataSet->SetSerieName("January","Serie1");
$DataSet->SetSerieName("February","Serie2");
// Initialise the graph
$Test = new pChart(700,230);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(50,30,585,200);
$Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
$Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE);
$Test->drawGrid(4,TRUE,230,230,230,50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf",6);
$Test->drawTreshold(0,143,55,72,TRUE,TRUE);
// Draw the bar graph
$Test->drawOverlayBarGraph($DataSet->GetData(),$DataSet->GetDataDescription());
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(600,30,$DataSet->GetDataDescription(),255,255,255);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(50,22,"Example 3",50,50,50,585);
$Test->Render("example3.png");
?>

View File

@ -1,45 +0,0 @@
<?php
/*
Example4 : Showing how to draw area
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->ImportFromCSV("Sample/datawithtitle.csv",",",array(1,2,3),TRUE,0);
$DataSet->AddSerie("Serie2");
$DataSet->SetAbsciseLabelSerie();
$DataSet->removeSerieName("Serie1");
$DataSet->removeSerieName("Serie3");
// Initialise the graph
$Test = new pChart(700,230);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(60,30,680,200);
$Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
$Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2);
$Test->drawGrid(4,TRUE,230,230,230,50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf",6);
$Test->drawTreshold(0,143,55,72,TRUE,TRUE);
// Draw the area
$Test->drawArea($DataSet->GetData(),"Serie1","Serie3",239,238,227,50);
// Draw the line graph
$Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());
$Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(65,35,$DataSet->GetDataDescription(),250,250,250);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(60,22,"Example 4",50,50,50,585);
$Test->Render("example4.png");
?>

View File

@ -1,42 +0,0 @@
<?php
/*
Example5 : A limits graph
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(1,4,-3,2,-3,3,2,1,0,7,4,-3,2,-3,3,5,1,0,7),"Serie1");
$DataSet->AddPoint(array(2,5,7,5,1,5,6,4,8,4,0,2,5,6,4,5,6,7,6),"Serie2");
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie();
$DataSet->SetSerieName("January","Serie1");
$DataSet->SetSerieName("February","Serie2");
// Initialise the graph
$Test = new pChart(700,230);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(50,30,585,200);
$Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
$Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE);
$Test->drawGrid(4,TRUE,230,230,230,50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf",6);
$Test->drawTreshold(0,143,55,72,TRUE,TRUE);
// Draw the limit graph
$Test->drawLimitsGraph($DataSet->GetData(),$DataSet->GetDataDescription(),180,180,180);
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(600,30,$DataSet->GetDataDescription(),255,255,255);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(50,22,"Example 5",50,50,50,585);
$Test->Render("example5.png");
?>

View File

@ -1,39 +0,0 @@
<?php
/*
Example6 : A simple filled line graph
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->ImportFromCSV("Sample/datawithtitle.csv",",",array(1,2,3),TRUE,0);
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie();
// Initialise the graph
$Test = new pChart(700,230);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(60,30,680,200);
$Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
$Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2);
$Test->drawGrid(4,TRUE,230,230,230,50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf",6);
$Test->drawTreshold(0,143,55,72,TRUE,TRUE);
// Draw the filled line graph
$Test->drawFilledLineGraph($DataSet->GetData(),$DataSet->GetDataDescription(),50,TRUE);
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(65,35,$DataSet->GetDataDescription(),255,255,255);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(60,22,"Example 6",50,50,50,585);
$Test->Render("example6.png");
?>

View File

@ -1,42 +0,0 @@
<?php
/*
Example7 : A filled cubic curve graph
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(1,4,3,2,3,3,2,1,0,7,4,3,2,3,3,5,1,0,7),"Serie1");
$DataSet->AddPoint(array(1,4,2,6,2,3,0,1,5,1,2,4,5,2,1,0,6,4,2),"Serie2");
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie();
$DataSet->SetSerieName("January","Serie1");
$DataSet->SetSerieName("February","Serie2");
// Initialise the graph
$Test = new pChart(700,230);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(50,30,585,200);
$Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
$Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2);
$Test->drawGrid(4,TRUE,230,230,230,50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf",6);
$Test->drawTreshold(0,143,55,72,TRUE,TRUE);
// Draw the cubic curve graph
$Test->drawFilledCubicCurve($DataSet->GetData(),$DataSet->GetDataDescription(),.1,50);
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(600,30,$DataSet->GetDataDescription(),255,255,255);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(50,22,"Example 7",50,50,50,585);
$Test->Render("example7.png");
?>

View File

@ -1,41 +0,0 @@
<?php
/*
Example8 : A radar graph
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array("Memory","Disk","Network","Slots","CPU"),"Label");
$DataSet->AddPoint(array(1,2,3,4,3),"Serie1");
$DataSet->AddPoint(array(1,4,2,6,2),"Serie2");
$DataSet->AddSerie("Serie1");
$DataSet->AddSerie("Serie2");
$DataSet->SetAbsciseLabelSerie("Label");
$DataSet->SetSerieName("Reference","Serie1");
$DataSet->SetSerieName("Tested computer","Serie2");
// Initialise the graph
$Test = new pChart(400,400);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawFilledRoundedRectangle(7,7,393,393,5,240,240,240);
$Test->drawRoundedRectangle(5,5,395,395,5,230,230,230);
$Test->setGraphArea(30,30,370,370);
$Test->drawFilledRoundedRectangle(30,30,370,370,5,255,255,255);
$Test->drawRoundedRectangle(30,30,370,370,5,220,220,220);
// Draw the radar graph
$Test->drawRadarAxis($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE,20,120,120,120,230,230,230);
$Test->drawFilledRadar($DataSet->GetData(),$DataSet->GetDataDescription(),50,20);
// Finish the graph
$Test->drawLegend(15,15,$DataSet->GetDataDescription(),255,255,255);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(0,22,"Example 8",50,50,50,400);
$Test->Render("example8.png");
?>

View File

@ -1,49 +0,0 @@
<?php
/*
Example9 : Showing how to use labels
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(0,70,70,0,0,70,70,0,0,70),"Serie1");
$DataSet->AddPoint(array(0.5,2,4.5,8,12.5,18,24.5,32,40.5,50),"Serie2");
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie();
$DataSet->SetSerieName("January","Serie1");
$DataSet->SetSerieName("February","Serie2");
// Initialise the graph
$Test = new pChart(700,230);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(50,30,585,200);
$Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
$Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2);
$Test->drawGrid(4,TRUE,230,230,230,50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf",6);
$Test->drawTreshold(0,143,55,72,TRUE,TRUE);
// Draw the line graph
$Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());
$Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);
// Set labels
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setLabel($DataSet->GetData(),$DataSet->GetDataDescription(),"Serie1","2","Daily incomes",221,230,174);
$Test->setLabel($DataSet->GetData(),$DataSet->GetDataDescription(),"Serie2","6","Production break",239,233,195);
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(600,30,$DataSet->GetDataDescription(),255,255,255);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(50,22,"Example 9",50,50,50,585);
$Test->Render("example9.png");
?>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,70 +0,0 @@
<?php
/*
Example21 : A single stacked bar graph
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(1,2,5),"Serie1");
$DataSet->AddPoint(array(3,2,2),"Serie2");
$DataSet->AddPoint(array(3,4,1),"Serie3");
$DataSet->AddPoint(array("A#~1","A#~2","A#~3"),"Labels");
$DataSet->AddAllSeries();
$DataSet->RemoveSerie("Labels");
$DataSet->SetAbsciseLabelSerie("Labels");
$DataSet->SetSerieName("Alpha","Serie1");
$DataSet->SetSerieName("Beta","Serie2");
$DataSet->SetSerieName("Gama","Serie3");
$DataSet->SetXAxisName("Samples IDs");
$DataSet->SetYAxisName("Test Marker");
$DataSet->SetYAxisUnit("µm");
// Initialise the graph
$Test = new pChart(380,400);
$Test->drawGraphAreaGradient(90,90,90,90,TARGET_BACKGROUND);
// Graph area setup
$Test->setFontProperties("Fonts/pf_arma_five.ttf",6);
$Test->setGraphArea(110,180,350,360);
$Test->drawGraphArea(213,217,221,FALSE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_ADDALLSTART0,213,217,221,TRUE,0,2,TRUE);
$Test->drawGraphAreaGradient(40,40,40,-50);
$Test->drawGrid(4,TRUE,230,230,230,5);
// Draw the title
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Title = " Average growth size for selected\r\n DNA samples ";
$Test->setLineStyle(2);
$Test->drawLine(51,-2,51,402,0,0,0);
$Test->setLineStyle(1);
$Test->drawTextBox(0,0,50,400,$Title,90,255,255,255,ALIGN_BOTTOM_CENTER,TRUE,0,0,0,30);
$Test->setFontProperties("Fonts/pf_arma_five.ttf",6);
// Draw the bar graph
$Test->drawStackedBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),70);
// Second chart
$DataSet->SetXAxisName("");
$Test->clearScale();
$Test->setGraphArea(110,20,350,140);
$Test->drawGraphArea(213,217,221,FALSE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_START0,213,217,221,TRUE,0,2);
$Test->drawGraphAreaGradient(40,40,40,-50);
$Test->drawGrid(4,TRUE,230,230,230,5);
// Draw the line chart
$Test->setShadowProperties(0,3,0,0,0,30,4);
$Test->drawFilledCubicCurve($DataSet->GetData(),$DataSet->GetDataDescription(),.1,40);
$Test->clearShadow();
// Write the legend
$Test->drawLegend(-2,3,$DataSet->GetDataDescription(),0,0,0,0,0,0,255,255,255,FALSE);
// Finish the graph
$Test->addBorder(1);
$Test->Render("HomePage2.png");
?>

View File

@ -1,34 +0,0 @@
<?php
/*
Naked: Naked and easy!
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(1,4,3,2,3,3,2,1,0,7,4,3,2,3,3,5,1,0,7));
$DataSet->AddSerie();
$DataSet->SetSerieName("Sample data","Serie1");
// Initialise the graph
$Test = new pChart(700,230);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->setGraphArea(40,30,680,200);
$Test->drawGraphArea(252,252,252,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2);
$Test->drawGrid(4,TRUE,230,230,230,70);
// Draw the line graph
$Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());
$Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(45,35,$DataSet->GetDataDescription(),255,255,255);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(60,22,"My pretty graph",50,50,50,585);
$Test->Render("Naked.png");
?>

View File

@ -1,37 +0,0 @@
Year,Jan.,Feb.,March,April,May,June,July,Aug.,Sept.,Oct.,Nov.,Dec.,Annual
1967,322.33,322.5,323.04,324.42,325,324.09,322.55,320.92,319.26,319.39,320.72,321.96,322.18
1968,322.57,323.15,323.89,325.02,325.57,325.36,324.14,322.11,320.33,320.25,321.32,322.9,323.05
1969,324,324.42,325.64,326.66,327.38,326.7,325.89,323.67,322.38,321.78,322.85,324.12,324.62
1970,325.06,325.98,326.93,328.13,328.07,327.66,326.35,324.69,323.1,323.07,324.01,325.13,325.68
1971,326.17,326.68,327.18,327.78,328.92,328.57,327.37,325.43,323.36,323.56,324.8,326.01,326.32
1972,326.77,327.63,327.75,329.72,330.07,329.09,328.05,326.32,324.84,325.2,326.5,327.55,327.46
1973,328.54,329.56,330.3,331.5,332.48,332.07,330.87,329.31,327.51,327.18,328.16,328.64,329.68
1974,329.35,330.71,331.48,332.65,333.09,332.25,331.18,329.4,327.44,327.37,328.46,329.58,330.25
1975,330.4,331.41,332.04,333.31,333.96,333.59,331.91,330.06,328.56,328.34,329.49,330.76,331.15
1976,331.74,332.56,333.5,334.58,334.87,334.34,333.05,330.94,329.3,328.94,330.31,331.68,332.15
1977,332.92,333.42,334.7,336.07,336.74,336.27,334.93,332.75,331.58,331.16,332.4,333.85,333.9
1978,334.97,335.39,336.64,337.76,338.01,337.89,336.54,334.68,332.76,332.54,333.92,334.95,335.5
1979,336.23,336.76,337.96,338.89,339.47,339.29,337.73,336.09,333.91,333.86,335.29,336.73,336.85
1980,338.01,338.36,340.08,340.77,341.46,341.17,339.56,337.6,335.88,336.01,337.1,338.21,338.69
1981,339.23,340.47,341.38,342.51,342.91,342.25,340.49,338.43,336.69,336.85,338.36,339.61,339.93
1982,340.75,341.61,342.7,343.56,344.13,343.35,342.06,339.82,337.97,337.86,339.26,340.49,341.13
1983,341.37,342.52,343.1,344.94,345.75,345.32,343.99,342.39,339.86,339.99,341.16,342.99,342.78
1984,343.7,344.51,345.28,347.08,347.43,346.79,345.4,343.28,341.07,341.35,342.98,344.22,344.42
1985,344.97,346,347.43,348.35,348.93,348.25,346.56,344.69,343.09,342.8,344.24,345.56,345.9
1986,346.29,346.96,347.86,349.55,350.21,349.54,347.94,345.91,344.86,344.17,345.66,346.9,347.15
1987,348.02,348.47,349.42,350.99,351.84,351.25,349.52,348.1,346.44,346.36,347.81,348.96,348.93
1988,350.43,351.72,352.22,353.59,354.22,353.79,352.39,350.44,348.72,348.88,350.07,351.34,351.48
1989,352.76,353.07,353.68,355.42,355.67,355.13,353.9,351.67,349.8,349.99,351.3,352.53,352.91
1990,353.66,354.7,355.39,356.2,357.16,356.22,354.82,352.91,350.96,351.18,352.83,354.21,354.19
1991,354.72,355.75,357.16,358.6,359.34,358.24,356.17,354.03,352.16,352.21,353.75,354.99,355.59
1992,355.98,356.72,357.81,359.15,359.66,359.25,357.03,355,353.01,353.31,354.16,355.4,356.37
1993,356.7,357.16,358.38,359.46,360.28,359.6,357.57,355.52,353.7,353.98,355.33,356.8,357.04
1994,358.36,358.91,359.97,361.26,361.68,360.95,359.55,357.49,355.84,355.99,357.58,359.04,358.88
1995,359.96,361,361.64,363.45,363.79,363.26,361.9,359.46,358.06,357.75,359.56,360.7,360.88
1996,362.05,363.25,364.03,364.72,365.41,364.97,363.65,361.49,359.46,359.6,360.76,362.33,362.64
1997,363.18,364,364.57,366.35,366.79,365.62,364.47,362.51,360.19,360.77,362.43,364.28,363.76
1998,365.32,366.15,367.31,368.61,369.3,368.87,367.64,365.77,363.9,364.23,365.46,366.97,366.63
1999,368.15,368.86,369.58,371.12,370.97,370.33,369.25,366.91,364.6,365.09,366.63,367.96,368.29
2000,369.08,369.4,370.45,371.59,371.75,371.62,370.04,368.04,366.54,366.63,368.2,369.43,369.4
2001,370.17,371.39,372,372.75,373.88,373.17,371.48,369.42,367.83,367.96,369.55,371.1,370.89
2002,372.29,372.94,373.38,374.71,375.4,375.26,373.87,371.35,370.57,370.1,371.93,373.63,372.95
1 Year Jan. Feb. March April May June July Aug. Sept. Oct. Nov. Dec. Annual
2 1967 322.33 322.5 323.04 324.42 325 324.09 322.55 320.92 319.26 319.39 320.72 321.96 322.18
3 1968 322.57 323.15 323.89 325.02 325.57 325.36 324.14 322.11 320.33 320.25 321.32 322.9 323.05
4 1969 324 324.42 325.64 326.66 327.38 326.7 325.89 323.67 322.38 321.78 322.85 324.12 324.62
5 1970 325.06 325.98 326.93 328.13 328.07 327.66 326.35 324.69 323.1 323.07 324.01 325.13 325.68
6 1971 326.17 326.68 327.18 327.78 328.92 328.57 327.37 325.43 323.36 323.56 324.8 326.01 326.32
7 1972 326.77 327.63 327.75 329.72 330.07 329.09 328.05 326.32 324.84 325.2 326.5 327.55 327.46
8 1973 328.54 329.56 330.3 331.5 332.48 332.07 330.87 329.31 327.51 327.18 328.16 328.64 329.68
9 1974 329.35 330.71 331.48 332.65 333.09 332.25 331.18 329.4 327.44 327.37 328.46 329.58 330.25
10 1975 330.4 331.41 332.04 333.31 333.96 333.59 331.91 330.06 328.56 328.34 329.49 330.76 331.15
11 1976 331.74 332.56 333.5 334.58 334.87 334.34 333.05 330.94 329.3 328.94 330.31 331.68 332.15
12 1977 332.92 333.42 334.7 336.07 336.74 336.27 334.93 332.75 331.58 331.16 332.4 333.85 333.9
13 1978 334.97 335.39 336.64 337.76 338.01 337.89 336.54 334.68 332.76 332.54 333.92 334.95 335.5
14 1979 336.23 336.76 337.96 338.89 339.47 339.29 337.73 336.09 333.91 333.86 335.29 336.73 336.85
15 1980 338.01 338.36 340.08 340.77 341.46 341.17 339.56 337.6 335.88 336.01 337.1 338.21 338.69
16 1981 339.23 340.47 341.38 342.51 342.91 342.25 340.49 338.43 336.69 336.85 338.36 339.61 339.93
17 1982 340.75 341.61 342.7 343.56 344.13 343.35 342.06 339.82 337.97 337.86 339.26 340.49 341.13
18 1983 341.37 342.52 343.1 344.94 345.75 345.32 343.99 342.39 339.86 339.99 341.16 342.99 342.78
19 1984 343.7 344.51 345.28 347.08 347.43 346.79 345.4 343.28 341.07 341.35 342.98 344.22 344.42
20 1985 344.97 346 347.43 348.35 348.93 348.25 346.56 344.69 343.09 342.8 344.24 345.56 345.9
21 1986 346.29 346.96 347.86 349.55 350.21 349.54 347.94 345.91 344.86 344.17 345.66 346.9 347.15
22 1987 348.02 348.47 349.42 350.99 351.84 351.25 349.52 348.1 346.44 346.36 347.81 348.96 348.93
23 1988 350.43 351.72 352.22 353.59 354.22 353.79 352.39 350.44 348.72 348.88 350.07 351.34 351.48
24 1989 352.76 353.07 353.68 355.42 355.67 355.13 353.9 351.67 349.8 349.99 351.3 352.53 352.91
25 1990 353.66 354.7 355.39 356.2 357.16 356.22 354.82 352.91 350.96 351.18 352.83 354.21 354.19
26 1991 354.72 355.75 357.16 358.6 359.34 358.24 356.17 354.03 352.16 352.21 353.75 354.99 355.59
27 1992 355.98 356.72 357.81 359.15 359.66 359.25 357.03 355 353.01 353.31 354.16 355.4 356.37
28 1993 356.7 357.16 358.38 359.46 360.28 359.6 357.57 355.52 353.7 353.98 355.33 356.8 357.04
29 1994 358.36 358.91 359.97 361.26 361.68 360.95 359.55 357.49 355.84 355.99 357.58 359.04 358.88
30 1995 359.96 361 361.64 363.45 363.79 363.26 361.9 359.46 358.06 357.75 359.56 360.7 360.88
31 1996 362.05 363.25 364.03 364.72 365.41 364.97 363.65 361.49 359.46 359.6 360.76 362.33 362.64
32 1997 363.18 364 364.57 366.35 366.79 365.62 364.47 362.51 360.19 360.77 362.43 364.28 363.76
33 1998 365.32 366.15 367.31 368.61 369.3 368.87 367.64 365.77 363.9 364.23 365.46 366.97 366.63
34 1999 368.15 368.86 369.58 371.12 370.97 370.33 369.25 366.91 364.6 365.09 366.63 367.96 368.29
35 2000 369.08 369.4 370.45 371.59 371.75 371.62 370.04 368.04 366.54 366.63 368.2 369.43 369.4
36 2001 370.17 371.39 372 372.75 373.88 373.17 371.48 369.42 367.83 367.96 369.55 371.1 370.89
37 2002 372.29 372.94 373.38 374.71 375.4 375.26 373.87 371.35 370.57 370.1 371.93 373.63 372.95

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1012 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1020 B

View File

View File

@ -1,20 +0,0 @@
1,0,1,0.5
2,1.204119983,4,2
3,4.294091292,9,4.5
4,9.632959861,16,8
5,17.47425011,25,12.5
6,28.01344501,36,18
7,41.40980396,49,24.5
8,57.79775917,64,32
9,77.29364326,81,40.5
10,100,100,50
11,126.0085149,121,60.5
12,155.4020994,144,72
13,188.2564265,169,84.5
14,224.641095,196,98
15,264.6205333,225,112.5
16,308.2547156,256,128
17,355.5997383,289,144.5
18,406.7082917,324,162
19,461.6300499,361,180.5
20,520.4119983,400,200
1 1 0 1 0.5
2 2 1.204119983 4 2
3 3 4.294091292 9 4.5
4 4 9.632959861 16 8
5 5 17.47425011 25 12.5
6 6 28.01344501 36 18
7 7 41.40980396 49 24.5
8 8 57.79775917 64 32
9 9 77.29364326 81 40.5
10 10 100 100 50
11 11 126.0085149 121 60.5
12 12 155.4020994 144 72
13 13 188.2564265 169 84.5
14 14 224.641095 196 98
15 15 264.6205333 225 112.5
16 16 308.2547156 256 128
17 17 355.5997383 289 144.5
18 18 406.7082917 324 162
19 19 461.6300499 361 180.5
20 20 520.4119983 400 200

View File

@ -1,21 +0,0 @@
Zob,January,February,March
1,0,1,0.5
2,1.204119983,4,2
3,4.294091292,9,4.5
4,9.632959861,16,8
5,17.47425011,25,12.5
6,28.01344501,36,18
7,41.40980396,49,24.5
8,57.79775917,64,32
9,77.29364326,81,40.5
10,100,100,50
11,126.0085149,121,60.5
12,155.4020994,144,72
13,188.2564265,169,84.5
14,224.641095,196,98
15,264.6205333,225,112.5
16,308.2547156,256,128
17,355.5997383,289,144.5
18,406.7082917,324,162
19,461.6300499,361,180.5
20,520.4119983,400,200
1 Zob January February March
2 1 0 1 0.5
3 2 1.204119983 4 2
4 3 4.294091292 9 4.5
5 4 9.632959861 16 8
6 5 17.47425011 25 12.5
7 6 28.01344501 36 18
8 7 41.40980396 49 24.5
9 8 57.79775917 64 32
10 9 77.29364326 81 40.5
11 10 100 100 50
12 11 126.0085149 121 60.5
13 12 155.4020994 144 72
14 13 188.2564265 169 84.5
15 14 224.641095 196 98
16 15 264.6205333 225 112.5
17 16 308.2547156 256 128
18 17 355.5997383 289 144.5
19 18 406.7082917 324 162
20 19 461.6300499 361 180.5
21 20 520.4119983 400 200

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -1,5 +0,0 @@
168,188,56
188,208,76
208,228,96
228,245,116
248,255,136

View File

@ -1,5 +0,0 @@
94,48,0
201,34,0
247,143,1
255,238,208
90,181,110

View File

@ -1,30 +0,0 @@
<?php
/*
SmallGraph: Let's go fast, draw small!
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(array(1,4,-3,2,-3,3,2,1,0,7,4,-3,2,-3,3,5,1,0,7),"Serie1");
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie();
$DataSet->SetSerieName("January","Serie1");
// Initialise the graph
$Test = new pChart(100,30);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawFilledRoundedRectangle(2,2,98,28,2,230,230,230);
$Test->setGraphArea(5,5,95,25);
$Test->drawGraphArea(255,255,255);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,220,220,220,FALSE);
// Draw the line graph
$Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());
// Finish the graph
$Test->Render("SmallGraph.png");
?>

View File

@ -1,48 +0,0 @@
<?php
/*
Example21 : A single stacked bar graph
*/
// Standard inclusions
include("pChart/pData.class");
include("pChart/pChart.class");
// Dataset definition
$DataSet = new pData;
$DataSet->AddPoint(1,"Serie1");
$DataSet->AddPoint(3,"Serie2");
$DataSet->AddPoint(3,"Serie3");
$DataSet->AddPoint("A#~1","Labels");
$DataSet->AddAllSeries();
$DataSet->RemoveSerie("Labels");
$DataSet->SetAbsciseLabelSerie("Labels");
$DataSet->SetSerieName("Alpha","Serie1");
$DataSet->SetSerieName("Beta","Serie2");
$DataSet->SetSerieName("Gama","Serie3");
$DataSet->SetYAxisName("Test Marker");
$DataSet->SetYAxisUnit("µm");
// Initialise the graph
$Test = new pChart(210,230);
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->setGraphArea(65,30,125,200);
$Test->drawFilledRoundedRectangle(7,7,203,223,5,240,240,240);
$Test->drawRoundedRectangle(5,5,205,225,5,230,230,230);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_ADDALLSTART0,150,150,150,TRUE,0,2,TRUE);
$Test->drawGrid(4,TRUE,230,230,230,50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf",6);
$Test->drawTreshold(0,143,55,72,TRUE,TRUE);
// Draw the bar graph
$Test->drawStackedBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),50);
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf",8);
$Test->drawLegend(135,150,$DataSet->GetDataDescription(),255,255,255);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(0,22,"Sample size",50,50,50,210);
$Test->Render("SmallStacked.png");
?>

View File

@ -1,63 +0,0 @@
ECHO OFF
CLS
ECHO Processing all examples
ECHO.
ECHO [01/28] A simple line chart
php -q %~dp0Example1.php
ECHO [02/28] A cubic curve graph
php -q %~dp0Example2.php
ECHO [03/28] An overlayed bar graph
php -q %~dp0Example3.php
ECHO [04/28] Showing how to draw area
php -q %~dp0Example4.php
ECHO [05/28] A limits graph
php -q %~dp0Example5.php
ECHO [06/28] A simple filled line graph
php -q %~dp0Example6.php
ECHO [07/28] A filled cubic curve graph
php -q %~dp0Example7.php
ECHO [08/28] A radar graph
php -q %~dp0Example8.php
ECHO [09/28] Showing how to use labels
php -q %~dp0Example9.php
ECHO [10/28] A 3D exploded pie graph
php -q %~dp0Example10.php
ECHO [11/28] A true bar graph
php -q %~dp0Example12.php
ECHO [12/28] A 2D exploded pie graph
php -q %~dp0Example13.php
ECHO [13/28] A smooth flat pie graph
php -q %~dp0Example14.php
ECHO [14/28] Playing with line style and pictures inclusion
php -q %~dp0Example15.php
ECHO [15/28] Importing CSV data
php -q %~dp0Example16.php
ECHO [16/28] Playing with axis
php -q %~dp0Example17.php
ECHO [17/28] Missing values
php -q %~dp0Example18.php
ECHO [18/28] Error reporting
php -q %~dp0Example19.php
ECHO [19/28] Stacked bar graph
php -q %~dp0Example20.php
ECHO [20/28] Playing with background
php -q %~dp0Example21.php
ECHO [21/28] Customizing plot charts
php -q %~dp0Example22.php
ECHO [22/28] Playing with background - Bis
php -q %~dp0Example23.php
ECHO [23/28] X Versus Y chart
php -q %~dp0Example24.php
ECHO [24/28] Using shadows
php -q %~dp0Example25.php
ECHO [25/28] Two Y axis / shadow demonstration
php -q %~dp0Example26.php
ECHO [26/28] Naked and easy!
php -q %~dp0Naked.php
ECHO [27/28] Let's go fast, draw small!
php -q %~dp0SmallGraph.php
ECHO [28/28] A Small stacked chart
php -q %~dp0SmallStacked.php
ECHO.
ECHO Rendering complete!
PAUSE

View File

@ -1,119 +0,0 @@
<?php
/*
pCache - Faster renderding using data cache
Copyright (C) 2008 Jean-Damien POGOLOTTI
Version 1.1.2 last updated on 06/17/08
http://pchart.sourceforge.net
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 1,2,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/>.
Class initialisation :
pCache($CacheFolder="Cache/")
Cache management :
IsInCache($Data)
GetFromCache($ID,$Data)
WriteToCache($ID,$Data,$Picture)
DeleteFromCache($ID,$Data)
ClearCache()
Inner functions :
GetHash($ID,$Data)
*/
/* pCache class definition */
class pCache
{
var $HashKey = "";
var $CacheFolder = "Cache/";
/* Create the pCache object */
function pCache($CacheFolder="Cache/")
{
$this->CacheFolder = $CacheFolder;
}
/* This function is clearing the cache folder */
function ClearCache()
{
if ($handle = opendir($this->CacheFolder))
{
while (false !== ($file = readdir($handle)))
{
if ( $file != "." && $file != ".." )
unlink($this->CacheFolder.$file);
}
closedir($handle);
}
}
/* This function is checking if we have an offline version of this chart */
function IsInCache($ID,$Data,$Hash="")
{
if ( $Hash == "" )
$Hash = $this->GetHash($ID,$Data);
if ( file_exists($this->CacheFolder.$Hash) )
return(TRUE);
else
return(FALSE);
}
/* This function is making a copy of drawn chart in the cache folder */
function WriteToCache($ID,$Data,$Picture)
{
$Hash = $this->GetHash($ID,$Data);
$FileName = $this->CacheFolder.$Hash;
imagepng($Picture->Picture,$FileName);
}
/* This function is removing any cached copy of this chart */
function DeleteFromCache($ID,$Data)
{
$Hash = $this->GetHash($ID,$Data);
$FileName = $this->CacheFolder.$Hash;
if ( file_exists($FileName ) )
unlink($FileName);
}
/* This function is retrieving the cached picture if applicable */
function GetFromCache($ID,$Data)
{
$Hash = $this->GetHash($ID,$Data);
if ( $this->IsInCache("","",$Hash ) )
{
$FileName = $this->CacheFolder.$Hash;
header('Content-type: image/png');
@readfile($FileName);
exit();
}
}
/* This function is building the graph unique hash key */
function GetHash($ID,$Data)
{
$mKey = "$ID";
foreach($Data as $key => $Values)
{
$tKey = "";
foreach($Values as $Serie => $Value)
$tKey = $tKey.$Serie.$Value;
$mKey = $mKey.md5($tKey);
}
return(md5($mKey));
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@ -1,260 +0,0 @@
<?php
/*
pData - Simplifying data population for pChart
Copyright (C) 2008 Jean-Damien POGOLOTTI
Version 1.13 last updated on 08/17/08
http://pchart.sourceforge.net
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 1,2,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/>.
Class initialisation :
pData()
Data populating methods :
ImportFromCSV($FileName,$Delimiter=",",$DataColumns=-1,$HasHeader=FALSE,$DataName=-1)
AddPoint($Value,$Serie="Serie1",$Description="")
Series manipulation methods :
AddSerie($SerieName="Serie1")
AddAllSeries()
RemoveSerie($SerieName="Serie1")
SetAbsciseLabelSerie($SerieName = "Name")
SetSerieName($Name,$SerieName="Serie1")
+ SetSerieSymbol($Name,$Symbol)
SetXAxisName($Name="X Axis")
SetYAxisName($Name="Y Axis")
SetXAxisFormat($Format="number")
SetYAxisFormat($Format="number")
SetXAxisUnit($Unit="")
SetYAxisUnit($Unit="")
removeSerieName($SerieName)
removeAllSeries()
Data retrieval methods :
GetData()
GetDataDescription()
*/
/* pData class definition */
class pData
{
var $Data;
var $DataDescription;
function pData()
{
$this->Data = "";
$this->DataDescription = "";
$this->DataDescription["Position"] = "Name";
$this->DataDescription["Format"]["X"] = "number";
$this->DataDescription["Format"]["Y"] = "number";
$this->DataDescription["Unit"]["X"] = NULL;
$this->DataDescription["Unit"]["Y"] = NULL;
}
function ImportFromCSV($FileName,$Delimiter=",",$DataColumns=-1,$HasHeader=FALSE,$DataName=-1)
{
$handle = @fopen($FileName,"r");
if ($handle)
{
$HeaderParsed = FALSE;
while (!feof($handle))
{
$buffer = fgets($handle, 4096);
$buffer = str_replace(chr(10),"",$buffer);
$buffer = str_replace(chr(13),"",$buffer);
$Values = split($Delimiter,$buffer);
if ( $buffer != "" )
{
if ( $HasHeader == TRUE && $HeaderParsed == FALSE )
{
if ( $DataColumns == -1 )
{
$ID = 1;
foreach($Values as $key => $Value)
{ $this->SetSerieName($Value,"Serie".$ID); $ID++; }
}
else
{
$SerieName = "";
foreach($DataColumns as $key => $Value)
$this->SetSerieName($Values[$Value],"Serie".$Value);
}
$HeaderParsed = TRUE;
}
else
{
if ( $DataColumns == -1 )
{
$ID = 1;
foreach($Values as $key => $Value)
{ $this->AddPoint(intval($Value),"Serie".$ID); $ID++; }
}
else
{
$SerieName = "";
if ( $DataName != -1 )
$SerieName = $Values[$DataName];
foreach($DataColumns as $key => $Value)
$this->AddPoint($Values[$Value],"Serie".$Value,$SerieName);
}
}
}
}
fclose($handle);
}
}
function AddPoint($Value,$Serie="Serie1",$Description="")
{
if (is_array($Value) && count($Value) == 1)
$Value = $Value[0];
$ID = 0;
for($i=0;$i<=count($this->Data);$i++)
{ if(isset($this->Data[$i][$Serie])) { $ID = $i+1; } }
if ( count($Value) == 1 )
{
$this->Data[$ID][$Serie] = $Value;
if ( $Description != "" )
$this->Data[$ID]["Name"] = $Description;
elseif (!isset($this->Data[$ID]["Name"]))
$this->Data[$ID]["Name"] = $ID;
}
else
{
foreach($Value as $key => $Val)
{
$this->Data[$ID][$Serie] = $Val;
if (!isset($this->Data[$ID]["Name"]))
$this->Data[$ID]["Name"] = $ID;
$ID++;
}
}
}
function AddSerie($SerieName="Serie1")
{
if ( !isset($this->DataDescription["Values"]) )
{
$this->DataDescription["Values"][] = $SerieName;
}
else
{
$Found = FALSE;
foreach($this->DataDescription["Values"] as $key => $Value )
if ( $Value == $SerieName ) { $Found = TRUE; }
if ( !$Found )
$this->DataDescription["Values"][] = $SerieName;
}
}
function AddAllSeries()
{
unset($this->DataDescription["Values"]);
if ( isset($this->Data[0]) )
{
foreach($this->Data[0] as $Key => $Value)
{
if ( $Key != "Name" )
$this->DataDescription["Values"][] = $Key;
}
}
}
function RemoveSerie($SerieName="Serie1")
{
if ( !isset($this->DataDescription["Values"]) )
return(0);
$Found = FALSE;
foreach($this->DataDescription["Values"] as $key => $Value )
{
if ( $Value == $SerieName )
unset($this->DataDescription["Values"][$key]);
}
}
function SetAbsciseLabelSerie($SerieName = "Name")
{
$this->DataDescription["Position"] = $SerieName;
}
function SetSerieName($Name,$SerieName="Serie1")
{
$this->DataDescription["Description"][$SerieName] = $Name;
}
function SetXAxisName($Name="X Axis")
{
$this->DataDescription["Axis"]["X"] = $Name;
}
function SetYAxisName($Name="Y Axis")
{
$this->DataDescription["Axis"]["Y"] = $Name;
}
function SetXAxisFormat($Format="number")
{
$this->DataDescription["Format"]["X"] = $Format;
}
function SetYAxisFormat($Format="number")
{
$this->DataDescription["Format"]["Y"] = $Format;
}
function SetXAxisUnit($Unit="")
{
$this->DataDescription["Unit"]["X"] = $Unit;
}
function SetYAxisUnit($Unit="")
{
$this->DataDescription["Unit"]["Y"] = $Unit;
}
function SetSerieSymbol($Name,$Symbol)
{
$this->DataDescription["Symbol"][$Name] = $Symbol;
}
function removeSerieName($SerieName)
{
if ( isset($this->DataDescription["Description"][$SerieName]) )
unset($this->DataDescription["Description"][$SerieName]);
}
function removeAllSeries()
{
foreach($this->DataDescription["Values"] as $Key => $Value)
unset($this->DataDescription["Values"][$Key]);
}
function GetData()
{
return($this->Data);
}
function GetDataDescription()
{
return($this->DataDescription);
}
}
?>