Subversion Repositories Applications.gtt

Compare Revisions

No changes between revisions

Ignore whitespace Rev 61 → Rev 161

/tags/v1.1-thales/bibliotheque/artichow/examples/tutorials/base-Gradient-radial.php
New file
0,0 → 1,24
<?php
require_once "../../Graph.class.php";
 
$graph = new Graph(250, 250);
 
$graph->border->hide();
 
$driver = $graph->getDriver();
 
$start = new Color(125, 250, 0);
$end = new Color(0, 125, 125);
 
// On dessine le dégradé radial dans un cercle
$driver->filledEllipse(
new RadialGradient(
$start,
$end
),
new Point(125, 125),
250, 250
);
 
$graph->draw();
?>
/tags/v1.1-thales/bibliotheque/artichow/examples/tutorials/line-Lines.php
New file
0,0 → 1,49
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../LinePlot.class.php";
 
$graph = new Graph(450, 400);
 
$graph->setAntiAliasing(TRUE);
 
$blue = new Color(0, 0, 200);
$red = new Color(200, 0, 0);
 
$group = new PlotGroup;
$group->setBackgroundColor(
new Color(240, 240, 240)
);
$group->setPadding(40, 40);
 
$values = array(12, 5, 20, 32, 15, 4, 16);
 
$plot = new LinePlot($values);
$plot->setColor($blue);
$plot->setYAxis(Plot::LEFT);
 
$group->add($plot);
 
$group->axis->left->setColor($blue);
$group->axis->left->title->set("Blue line");
 
$values = array(6, 12, 14, 2, 11, 5, 21);
 
$plot = new LinePlot($values);
$plot->setColor($red);
$plot->setYAxis(Plot::RIGHT);
 
$group->add($plot);
 
$group->axis->right->setColor($red);
$group->axis->right->title->set("Red line");
 
$graph->add($group);
$graph->draw();
?>
/tags/v1.1-thales/bibliotheque/artichow/examples/tutorials/smiley.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.1-thales/bibliotheque/artichow/examples/tutorials/smiley.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.1-thales/bibliotheque/artichow/examples/tutorials/AntiSpam/valid.php
New file
0,0 → 1,11
<?php
require_once "../../../AntiSpam.class.php";
 
$object = new AntiSpam();
 
if($object->check('example', $_GET['code'])) {
echo "Good value :-)";
} else {
echo "Bad value :-(";
}
?>
/tags/v1.1-thales/bibliotheque/artichow/examples/tutorials/AntiSpam/spam.php
New file
0,0 → 1,18
<?php
 
require_once '../../../AntiSpam.class.php';
 
// On créé l'image anti-spam
$object = new AntiSpam();
 
// La valeur affichée sur l'image fera 5 caractères
$object->setRand(5);
 
// On assigne un nom à cette image pour vérifier
// ultérieurement la valeur fournie par l'utilisateur
$object->save('example');
 
// On affiche l'image à l'écran
$object->draw();
 
?>
/tags/v1.1-thales/bibliotheque/artichow/examples/tutorials/AntiSpam/form.php
New file
0,0 → 1,5
<form action="valid.php" method="get">
<img src="spam.php" style="vertical-align: middle"/>
<input type="text" name="code"/>
<input type="submit" value="Submit"/>
</form>
/tags/v1.1-thales/bibliotheque/artichow/examples/tutorials/base-Color.php
New file
0,0 → 1,40
<?php
require_once "../../Graph.class.php";
 
$graph = new Graph(400, 30);
 
$graph->border->hide();
 
$driver = $graph->getDriver();
 
for($i = 7; $i < 400; $i += 15) {
$driver->line(
new Color(0, 0, 0),
new Line(
new Point($i, 0),
new Point($i, 30)
)
);
}
 
for($i = 7; $i < 30; $i += 15) {
$driver->line(
new Color(0, 0, 0),
new Line(
new Point(0, $i),
new Point(400, $i)
)
);
}
 
$driver->filledRectangle(
new Color(0, 100, 200, 50),
new Line(
new Point(0, 0),
new Point(400, 30)
)
);
 
$graph->draw();
 
?>
/tags/v1.1-thales/bibliotheque/artichow/examples/tutorials/line-Customize.php
New file
0,0 → 1,50
<?php
require_once "../../LinePlot.class.php";
 
$graph = new Graph(400, 300);
 
$graph->setAntiAliasing(TRUE);
 
$values = array(1, 7, 3, 2.5, 5, -4.5, -5);
$plot = new LinePlot($values);
$plot->setBackgroundColor(new Color(245, 245, 245));
 
$plot->hideLine(TRUE);
$plot->setFillColor(new Color(180, 180, 180, 75));
 
$plot->grid->setBackgroundColor(new Color(235, 235, 180, 60));
 
$plot->yAxis->setLabelPrecision(2);
$plot->yAxis->setLabelNumber(6);
 
$days = array(
'Lundi',
'Mardi',
'Mercredi',
'Jeudi',
'Vendredi',
'Samedi',
'Dimanche'
);
$plot->xAxis->setLabelText($days);
$plot->setSpace(6, 6, 10, 10);
 
$plot->mark->setType(Mark::IMAGE);
$plot->mark->setImage(new FileImage("smiley.png"));
 
$plot->label->set($values);
$plot->label->move(0, -23);
$plot->label->setBackgroundGradient(
new LinearGradient(
new Color(250, 250, 250, 10),
new Color(255, 200, 200, 30),
0
)
);
$plot->label->border->setColor(new Color(20, 20, 20, 20));
$plot->label->setPadding(3, 1, 1, 0);
 
$graph->add($plot);
$graph->draw();
?>
/tags/v1.1-thales/bibliotheque/artichow/examples/tutorials/bar-Bars.php
New file
0,0 → 1,47
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../BarPlot.class.php";
 
$graph = new Graph(450, 400);
 
$graph->setAntiAliasing(TRUE);
 
$blue = new Color(0, 0, 200);
$red = new Color(200, 0, 0);
 
$group = new PlotGroup;
$group->setPadding(40, 40);
$group->setBackgroundColor(
new Color(240, 240, 240)
);
 
$values = array(12, 8, 20, 32, 15, 5);
 
$plot = new BarPlot($values, 1, 2);
$plot->setBarColor($blue);
$plot->setYAxis(Plot::LEFT);
 
$group->add($plot);
$group->axis->left->setColor($blue);
$group->axis->left->title->set("Blue bars");
 
$values = array(6, 12, 14, 2, 11, 7);
 
$plot = new BarPlot($values, 2, 2);
$plot->setBarColor($red);
$plot->setYAxis(Plot::RIGHT);
 
$group->add($plot);
$group->axis->right->setColor($red);
$group->axis->right->title->set("Red bars");
 
$graph->add($group);
$graph->draw();
?>
/tags/v1.1-thales/bibliotheque/artichow/examples/tutorials/bar-Simple.php
New file
0,0 → 1,31
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../BarPlot.class.php";
 
$graph = new Graph(400, 400);
 
$graph->setAntiAliasing(TRUE);
 
$values = array(19, 42, 15, -25, 3);
$plot = new BarPlot($values);
$plot->setBarColor(
new Color(250, 230, 180)
);
$plot->setSpace(5, 5, NULL, NULL);
 
$plot->barShadow->setSize(4);
$plot->barShadow->setPosition(Shadow::RIGHT_TOP);
$plot->barShadow->setColor(new Color(180, 180, 180, 10));
$plot->barShadow->smooth(TRUE);
 
$graph->add($plot);
$graph->draw();
 
?>
/tags/v1.1-thales/bibliotheque/artichow/examples/tutorials/base-Gradient-linear.php
New file
0,0 → 1,25
<?php
 
require_once "../../Graph.class.php";
 
$graph = new Graph(400, 30);
 
$graph->border->hide();
 
$driver = $graph->getDriver();
 
$driver->filledRectangle(
new LinearGradient(
new Black,
new White,
0
),
new Line(
new Point(0, 0),
new Point(400, 30)
)
);
 
$graph->draw();
 
?>
/tags/v1.1-thales/bibliotheque/artichow/examples/tutorials/line-Simple.php
New file
0,0 → 1,22
<?php
require_once "../../LinePlot.class.php";
 
$graph = new Graph(400, 400);
 
$graph->setAntiAliasing(FALSE);
 
$values = array(1, 4, 5, -2.5, 3);
$plot = new LinePlot($values);
$plot->setBackgroundGradient(
new LinearGradient(
new Color(210, 210, 210),
new Color(250, 250, 250),
0
)
);
$plot->yAxis->setLabelPrecision(1);
$plot->setSpace(5, 5, NULL, NULL);
 
$graph->add($plot);
$graph->draw();
?>
/tags/v1.1-thales/bibliotheque/artichow/examples/tutorials/plot-More.php
New file
0,0 → 1,47
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
 
require_once "../../BarPlot.class.php";
require_once "../../LinePlot.class.php";
 
$graph = new Graph(450, 400);
 
$graph->setAntiAliasing(TRUE);
 
$blue = new Color(150, 150, 230, 50);
$red = new Color(240, 50, 50, 25);
 
$group = new PlotGroup;
$group->setSpace(5, 5, 5, 0);
$group->setBackgroundColor(
new Color(240, 240, 240)
);
 
$values = array(18, 12, 14, 21, 11, 7, 9, 16, 7, 23);
 
$plot = new BarPlot($values);
$plot->setBarColor($red);
 
$group->add($plot);
 
$values = array(12, 8, 6, 12, 7, 5, 4, 9, 3, 12);
 
$plot = new LinePlot($values, LinePlot::MIDDLE);
$plot->setFillColor($blue);
 
$plot->mark->setType(Mark::SQUARE);
$plot->mark->setSize(7);
$plot->mark->setFill(new Color(255, 255, 255));
$plot->mark->border->show();
 
$group->add($plot);
 
$graph->add($group);
$graph->draw();
?>