Version 1.9g
This commit is contained in:
parent
d028822d0b
commit
4c9814a99c
800 changed files with 237325 additions and 1949 deletions
46
artichow/examples/line-010.php
Normal file
46
artichow/examples/line-010.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?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(375, 200);
|
||||
|
||||
// Set title
|
||||
$graph->title->set('Star marks');
|
||||
$graph->title->setFont(new Tuffy(12));
|
||||
$graph->title->setColor(new DarkRed);
|
||||
|
||||
$plot = new LinePlot(array(5, 3, 4, 7, 6, 5, 8, 4, 7));
|
||||
|
||||
// Change plot size and position
|
||||
$plot->setSize(0.76, 1);
|
||||
$plot->setCenter(0.38, 0.5);
|
||||
|
||||
$plot->setPadding(30, 15, 38, 25);
|
||||
$plot->setColor(new Orange());
|
||||
$plot->setFillColor(new LightOrange(80));
|
||||
|
||||
// Change grid style
|
||||
$plot->grid->setType(Line::DASHED);
|
||||
|
||||
// Add customized marks
|
||||
$plot->mark->setType(Mark::STAR);
|
||||
$plot->mark->setFill(new MidRed);
|
||||
$plot->mark->setSize(6);
|
||||
|
||||
// Change legend
|
||||
$plot->legend->setPosition(1, 0.5);
|
||||
$plot->legend->setAlign(Legend::LEFT);
|
||||
$plot->legend->shadow->smooth(TRUE);
|
||||
|
||||
$plot->legend->add($plot, 'My line', Legend::MARK);
|
||||
|
||||
$graph->add($plot);
|
||||
$graph->draw();
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue