EZ-Components

This commit is contained in:
Andreas Österreicher
2009-02-17 15:27:43 +00:00
parent 359c3c55c9
commit 0a8e90a8b3
572 changed files with 64490 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -0,0 +1,191 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="450"
height="250"
id="svg2"
sodipodi:version="0.32"
inkscape:version="0.44.1"
version="1.0"
sodipodi:docbase="/home/kore/devel/ezcomponents/trunk/Graph/docs"
sodipodi:docname="template.svg">
<defs
id="defs4">
<linearGradient
inkscape:collect="always"
id="linearGradient16118">
<stop
style="stop-color:white;stop-opacity:1;"
offset="0"
id="stop16120" />
<stop
style="stop-color:white;stop-opacity:0;"
offset="1"
id="stop16122" />
</linearGradient>
<linearGradient
id="linearGradient3647">
<stop
style="stop-color:#204a8f;stop-opacity:0.94117647;"
offset="0"
id="stop3649" />
<stop
style="stop-color:#729fcf;stop-opacity:1;"
offset="1"
id="stop3651" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3647"
id="linearGradient3653"
x1="449.50012"
y1="249.5"
x2="0.49999967"
y2="0.5000025"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.002227,0,0,1.004016,-0.501113,-0.502011)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient16118"
id="linearGradient16116"
x1="104.98172"
y1="-14.882813"
x2="104.98172"
y2="-31.496094"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(336.4453,-2.121318)" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
gridtolerance="10000"
guidetolerance="10"
objecttolerance="10"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1"
inkscape:cx="225"
inkscape:cy="125"
inkscape:document-units="px"
inkscape:current-layer="layer1"
width="450px"
height="250px"
inkscape:window-width="1024"
inkscape:window-height="699"
inkscape:window-x="0"
inkscape:window-y="24" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<rect
style="opacity:1;fill:url(#linearGradient3653);fill-opacity:1;stroke:none;stroke-width:0.99999988;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect2760"
width="450"
height="250"
x="0"
y="-1.7763568e-15" />
<rect
style="opacity:1;fill:white;fill-opacity:0.58823532;stroke:white;stroke-width:0.99999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect1872"
width="399"
height="199"
x="25.5"
y="40.5"
rx="0"
ry="0" />
<path
style="opacity:0.5;fill:white;fill-opacity:1;stroke:none;stroke-width:0.99999988;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 50.46875 0 L 74.625 8.21875 L 0 55.5625 L 0 61.53125 L 80.75 10.3125 L 141.03125 30.84375 L 73.5 89.03125 L 0 67.75 L 0 73 L 69 92.9375 L 0 152.40625 L 0 159.03125 L 74.71875 94.625 L 157.25 118.5 L 101.0625 186.40625 L 0 161.6875 L 0 166.8125 L 97.53125 190.6875 L 48.46875 250 L 54.9375 250 L 102.9375 192 L 206.375 217.3125 L 188.28125 250 L 193.96875 250 L 211.375 218.53125 L 312.5625 243.28125 L 310.25 250 L 315.53125 250 L 317.4375 244.46875 L 340.03125 250 L 361 250 L 319.09375 239.75 L 342.53125 172.09375 L 436.0625 199.15625 L 429.6875 250 L 434.75 250 L 440.9375 200.5625 L 450 203.1875 L 450 198 L 441.5625 195.5625 L 449.0625 135.6875 L 450 136 L 450 130.71875 L 449.6875 130.625 L 450 128.125 L 450 87.71875 L 444.84375 128.96875 L 366.6875 102.34375 L 384.8125 49.96875 L 450 73.34375 L 450 68.03125 L 386.46875 45.25 L 400.8125 3.8125 L 450 23.21875 L 450 17.84375 L 404.78125 0 L 391.15625 0 L 396.15625 1.96875 L 381.75 43.5625 L 320.375 21.53125 L 332.28125 0 L 326.5625 0 L 315.59375 19.84375 L 261.4375 0.40625 L 261.78125 0 L 245.4375 0 L 253.03125 2.71875 L 213.6875 50.25 L 150.96875 28.90625 L 184.5 0 L 176.8125 0 L 145.4375 27.03125 L 86.1875 6.84375 L 96.96875 0 L 87.59375 0 L 80.0625 4.78125 L 66.03125 0 L 50.46875 0 z M 258.03125 4.53125 L 313.125 24.28125 L 285.28125 74.625 L 218.75 52 L 258.03125 4.53125 z M 317.90625 26 L 380.125 48.28125 L 361.9375 100.75 L 290.09375 76.28125 L 317.90625 26 z M 146.5625 32.71875 L 210.25 54.40625 L 160.71875 114.28125 L 79.25 90.71875 L 146.5625 32.71875 z M 215.34375 56.125 L 282.8125 79.09375 L 249.1875 139.875 L 165.96875 115.8125 L 215.34375 56.125 z M 287.625 80.75 L 360.3125 105.46875 L 339.34375 165.96875 L 254.125 141.3125 L 287.625 80.75 z M 365.03125 107.09375 L 444.21875 134.0625 L 436.6875 194.15625 L 344.15625 167.375 L 365.03125 107.09375 z M 162.5 120 L 246.71875 144.375 L 208.875 212.78125 L 106.46875 187.71875 L 162.5 120 z M 251.625 145.78125 L 337.71875 170.6875 L 314.21875 238.5625 L 213.875 214 L 251.625 145.78125 z "
id="rect5461" />
<rect
ry="0"
rx="0"
y="36.5"
x="29.5"
height="199"
width="399"
id="rect7236"
style="opacity:0.8;fill:none;fill-opacity:1;stroke:white;stroke-width:0.99999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
style="opacity:0.6;fill:none;fill-opacity:1;stroke:white;stroke-width:0.99999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect7238"
width="399"
height="199"
x="33.5"
y="32.5"
rx="0"
ry="0" />
<rect
ry="0"
rx="0"
y="28.5"
x="37.5"
height="199"
width="399"
id="rect7240"
style="opacity:0.4;fill:none;fill-opacity:1;stroke:white;stroke-width:0.99999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
style="opacity:0.2;fill:none;fill-opacity:1;stroke:white;stroke-width:0.99999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect9014"
width="399"
height="199"
x="41.5"
y="24.5"
rx="0"
ry="0" />
<rect
ry="0"
rx="0"
y="20.5"
x="45.5"
height="199"
width="399"
id="rect9016"
style="opacity:0.1;fill:none;fill-opacity:1;stroke:white;stroke-width:0.99999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<text
xml:space="preserve"
style="font-size:17.16649818px;font-style:normal;font-weight:normal;fill:white;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
x="361.1604"
y="20.04665"
id="text14332"><tspan
sodipodi:role="line"
id="tspan14334"
x="361.1604"
y="20.04665">ezcGraph</tspan></text>
<text
id="text15221"
y="-20.574902"
x="361.1604"
style="font-size:17.16649818px;font-style:normal;font-weight:normal;opacity:0.67307691;fill:url(#linearGradient16116);fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
xml:space="preserve"
transform="scale(1,-1)"><tspan
y="-20.574902"
x="361.1604"
id="tspan15223"
sodipodi:role="line"
style="fill:url(#linearGradient16116);fill-opacity:1">ezcGraph</tspan></text>
<g id="ezcGraph" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.2 KiB

@@ -0,0 +1,20 @@
<?php
$dir = dirname( dirname( __FILE__ ) );
$dirParts = explode( '/', $dir );
switch ( $dirParts[count( $dirParts ) - 3] )
{
case 'doc': require_once 'ezc/Base/base.php'; break; // pear
case 'trunk': require_once "$dir/../../Base/src/base.php"; break; // svn
default: require_once "$dir/../../Base/src/base.php"; break; // bundle
}
/**
* Autoload ezc classes
*
* @param string $className
*/
function __autoload( $className )
{
ezcBase::autoload( $className );
}
?>
@@ -0,0 +1,33 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphLineChart();
$graph->options->fillLines = 210;
$graph->title = 'Concurrent requests';
$graph->legend = false;
$graph->xAxis = new ezcGraphChartElementDateAxis();
// Add data
$graph->data['Machine 1'] = new ezcGraphArrayDataSet( array(
'8:00' => 3241,
'8:13' => 934,
'8:24' => 1201,
'8:27' => 1752,
'8:51' => 123,
) );
$graph->data['Machine 2'] = new ezcGraphArrayDataSet( array(
'8:05' => 623,
'8:12' => 2103,
'8:33' => 543,
'8:43' => 2034,
'8:59' => 3410,
) );
$graph->data['Machine 1']->symbol = ezcGraph::BULLET;
$graph->data['Machine 2']->symbol = ezcGraph::BULLET;
$graph->render( 400, 150, 'tutorial_axis_datetime.svg' );
?>
@@ -0,0 +1,31 @@
<?php
require_once 'tutorial_autoload.php';
$wikidata = include 'tutorial_wikipedia_data.php';
$graph = new ezcGraphLineChart();
$graph->options->fillLines = 210;
$graph->options->font->maxFontSize = 10;
$graph->title = 'Error level colors';
$graph->legend = false;
$graph->yAxis = new ezcGraphChartElementLabeledAxis();
$graph->yAxis->axisLabelRenderer->showZeroValue = true;
$graph->yAxis->label = 'Color';
$graph->xAxis->label = 'Error level';
// Add data
$graph->data['colors'] = new ezcGraphArrayDataSet(
array(
'info' => 'blue',
'notice' => 'green',
'warning' => 'orange',
'error' => 'red',
'fatal' => 'red',
)
);
$graph->render( 400, 150, 'tutorial_axis_labeled.svg' );
?>
@@ -0,0 +1,32 @@
<?php
require_once 'tutorial_autoload.php';
$wikidata = include 'tutorial_wikipedia_data.php';
$graph = new ezcGraphLineChart();
$graph->title = 'Some random data';
$graph->legend = false;
$graph->xAxis = new ezcGraphChartElementNumericAxis();
$graph->xAxis->min = -15;
$graph->xAxis->max = 15;
$graph->xAxis->majorStep = 5;
$data = array(
array(),
array()
);
for ( $i = -10; $i <= 10; $i++ )
{
$data[0][$i] = mt_rand( -23, 59 );
$data[1][$i] = mt_rand( -23, 59 );
}
// Add data
$graph->data['random blue'] = new ezcGraphArrayDataSet( $data[0] );
$graph->data['random green'] = new ezcGraphArrayDataSet( $data[1] );
$graph->render( 400, 150, 'tutorial_axis_numeric.svg' );
?>
@@ -0,0 +1,17 @@
<?php
require_once 'tutorial_autoload.php';
$wikidata = include 'tutorial_wikipedia_data.php';
$graph = new ezcGraphBarChart();
$graph->title = 'Wikipedia articles';
// Add data
foreach ( $wikidata as $language => $data )
{
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
}
$graph->render( 400, 150, 'tutorial_bar_chart.svg' );
?>
@@ -0,0 +1,26 @@
<?php
require_once 'tutorial_autoload.php';
$wikidata = include 'tutorial_wikipedia_data.php';
$graph = new ezcGraphBarChart();
$graph->palette = new ezcGraphPaletteEz();
$graph->title = 'Wikipedia articles';
// Add data
foreach ( $wikidata as $language => $data )
{
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
}
$graph->data['English']->symbol = ezcGraph::NO_SYMBOL;
$graph->data['German']->symbol = ezcGraph::BULLET;
$graph->data['Norwegian']->symbol = ezcGraph::DIAMOND;
$graph->renderer = new ezcGraphRenderer3d();
$graph->renderer->options->legendSymbolGleam = .5;
$graph->renderer->options->barChartGleam = .5;
$graph->render( 400, 150, 'tutorial_bar_chart_3d.svg' );
?>
@@ -0,0 +1,35 @@
<?php
require_once 'tutorial_autoload.php';
$wikidata = include 'tutorial_wikipedia_data.php';
$graph = new ezcGraphBarChart();
$graph->title = 'Wikipedia articles';
// Add data
foreach ( $wikidata as $language => $data )
{
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
}
$graph->data['German']->displayType = ezcGraph::LINE;
$graph->data['German']->highlight = true;
$graph->data['German']->highlight['Mar 2006'] = false;
$graph->options->fillLines = 210;
$graph->options->highlightSize = 12;
$graph->options->highlightFont->background = '#EEEEEC88';
$graph->options->highlightFont->border = '#000000';
$graph->options->highlightFont->borderWidth = 1;
// $graph->renderer = new ezcGraphRenderer2d();
$graph->renderer->options->barMargin = .2;
$graph->renderer->options->barPadding = .2;
$graph->renderer->options->dataBorder = 0;
$graph->render( 400, 150, 'tutorial_bar_chart_options.svg' );
?>
@@ -0,0 +1,20 @@
<?php
require_once 'tutorial_autoload.php';
$wikidata = include 'tutorial_wikipedia_data.php';
$graph = new ezcGraphBarChart();
$graph->title = 'Wikipedia articles';
// Add data
foreach ( $wikidata as $language => $data )
{
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
}
$graph->data['German']->displayType = ezcGraph::LINE;
$graph->options->fillLines = 210;
$graph->render( 400, 150, 'tutorial_bar_line_chart.svg' );
?>
@@ -0,0 +1,28 @@
<?php
require_once 'tutorial_autoload.php';
$wikidata = include 'tutorial_wikipedia_data.php';
$graph = new ezcGraphBarChart();
$graph->title = 'Wikipedia articles';
// Add data
foreach ( $wikidata as $language => $data )
{
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
}
$graph->data['German']->displayType = ezcGraph::LINE;
$graph->data['German']->highlight = true;
$graph->data['German']->highlight['Mar 2006'] = false;
$graph->options->fillLines = 210;
$graph->options->highlightSize = 12;
$graph->options->highlightFont->background = '#EEEEEC88';
$graph->options->highlightFont->border = '#000000';
$graph->options->highlightFont->borderWidth = 1;
$graph->render( 400, 150, 'tutorial_bar_options.svg' );
?>
@@ -0,0 +1,23 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEzRed();
$graph->title = 'Access statistics';
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
'Mozilla' => 19113,
'Explorer' => 10917,
'Opera' => 1464,
'Safari' => 652,
'Konqueror' => 474,
) );
$graph->background->image = 'ez.png';
$graph->background->position = ezcGraph::BOTTOM | ezcGraph::RIGHT;
$graph->background->repeat = ezcGraph::NO_REPEAT;
$graph->render( 400, 150, 'tutorial_chart_background.svg' );
?>
@@ -0,0 +1,21 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEzGreen();
$graph->title = 'Access statistics';
$graph->legend = false;
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
'Mozilla' => 19113,
'Explorer' => 10917,
'Opera' => 1464,
'Safari' => 652,
'Konqueror' => 474,
) );
$graph->render( 400, 150, 'tutorial_chart_legend.svg' );
?>
@@ -0,0 +1,26 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEzBlue();
$graph->title = 'Access statistics';
$graph->options->font->name = 'serif';
$graph->title->background = '#EEEEEC';
$graph->title->font->name = 'sans-serif';
$graph->options->font->maxFontSize = 8;
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
'Mozilla' => 19113,
'Explorer' => 10917,
'Opera' => 1464,
'Safari' => 652,
'Konqueror' => 474,
) );
$graph->render( 400, 150, 'tutorial_chart_title.svg' );
?>
@@ -0,0 +1,32 @@
<?php
require_once 'tutorial_autoload.php';
$wikidata = include 'tutorial_wikipedia_data.php';
$graph = new ezcGraphRadarChart();
$graph->palette = new ezcGraphPaletteEzBlue();
$graph->options->fillLines = 220;
$graph->legend->position = ezcGraph::BOTTOM;
$graph->rotationAxis = new ezcGraphChartElementNumericAxis();
$graph->rotationAxis->majorStep = 2;
$graph->rotationAxis->minorStep = .5;
mt_srand( 5 );
$data = array();
for ( $i = 0; $i <= 10; $i++ )
{
$data[$i] = mt_rand( -5, 5 );
}
$data[$i - 1] = reset( $data );
$graph->data['random data'] = $dataset = new ezcGraphArrayDataSet( $data );
$average = new ezcGraphDataSetAveragePolynom( $dataset, 4 );
$graph->data[(string) $average->getPolynom()] = $average;
$graph->data[(string) $average->getPolynom()]->symbol = ezcGraph::NO_SYMBOL;
$graph->data[(string) $average->getPolynom()]->color = '#9CAE86';
$graph->render( 500, 250, 'tutorial_complex_radar_chart.svg' );
?>
@@ -0,0 +1,36 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphOdometerChart();
$graph->title = 'Custom odometer';
$graph->data['data'] = new ezcGraphArrayDataSet(
array( 87 )
);
// Set the marker color
$graph->data['data']->color[0] = '#A0000055';
// Set colors for the background gradient
$graph->options->startColor = '#2E3436';
$graph->options->endColor = '#EEEEEC';
// Define a border for the odometer
$graph->options->borderWidth = 2;
$graph->options->borderColor = '#BABDB6';
// Set marker width
$graph->options->markerWidth = 5;
// Set space, which the odometer may consume
$graph->options->odometerHeight = .7;
// Set axis span and label
$graph->axis->min = 0;
$graph->axis->max = 100;
$graph->axis->label = 'Coverage ';
$graph->render( 400, 150, 'tutorial_custom_odometer_chart.svg' );
?>
@@ -0,0 +1,22 @@
<?php
require_once 'tutorial_autoload.php';
require_once 'tutorial_custom_palette_palette.php';
$wikidata = include 'tutorial_wikipedia_data.php';
$graph = new ezcGraphBarChart();
$graph->palette = new tutorialCustomPalette();
$graph->title = 'Wikipedia articles';
// Add data
foreach ( $wikidata as $language => $data )
{
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
}
$graph->data['German']->displayType = ezcGraph::LINE;
$graph->options->fillLines = 210;
$graph->render( 400, 150, 'tutorial_custom_palette.svg' );
?>
@@ -0,0 +1,24 @@
<?php
class tutorialCustomPalette extends ezcGraphPalette
{
protected $axisColor = '#000000';
protected $majorGridColor = '#000000BB';
protected $dataSetColor = array(
'#4E9A0688',
'#3465A4',
'#F57900'
);
protected $dataSetSymbol = array(
ezcGraph::BULLET,
);
protected $fontName = 'sans-serif';
protected $fontColor = '#555753';
}
?>
@@ -0,0 +1,25 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphLineChart();
$graph->title = 'Some random data';
$graph->legend->position = ezcGraph::BOTTOM;
$graph->xAxis = new ezcGraphChartElementNumericAxis();
$data = array();
for ( $i = 0; $i <= 10; $i++ )
{
$data[$i] = mt_rand( -5, 5 );
}
// Add data
$graph->data['random data'] = $dataset = new ezcGraphArrayDataSet( $data );
$average = new ezcGraphDataSetAveragePolynom( $dataset, 3 );
$graph->data[(string) $average->getPolynom()] = $average;
$graph->render( 400, 150, 'tutorial_dataset_average.svg' );
?>
@@ -0,0 +1,24 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphLineChart();
$graph->title = 'Sinus';
$graph->legend->position = ezcGraph::BOTTOM;
$graph->xAxis = new ezcGraphChartElementNumericAxis();
$graph->data['sinus'] = new ezcGraphNumericDataSet(
-360, // Start value
360, // End value
create_function(
'$x',
'return sin( deg2rad( $x ) );'
)
);
$graph->data['sinus']->resolution = 120;
$graph->render( 400, 150, 'tutorial_dataset_numeric.svg' );
?>
@@ -0,0 +1,36 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->title = 'Access statistics';
$graph->options->label = '%2$d (%3$.1f%%)';
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
'Mozilla' => 19113,
'Explorer' => 10917,
'Opera' => 1464,
'Safari' => 652,
'Konqueror' => 474,
) );
$graph->data['Access statistics']->highlight['Explorer'] = true;
$graph->data['Access statistics']->symbol = ezcGraph::BULLET;
$graph->renderer = new ezcGraphRenderer3d();
$graph->renderer->options->pieChartShadowSize = 5;
$graph->renderer->options->pieChartShadowColor = ezcGraphColor::create( '#000000' );
$graph->renderer->options->pieChartGleam = .5;
$graph->renderer->options->dataBorder = false;
$graph->renderer->options->pieChartHeight = 8;
$graph->renderer->options->pieChartSymbolColor = '#888A8588';
$graph->renderer->options->pieChartRotation = .8;
$graph->renderer->options->legendSymbolGleam = .5;
$graph->renderer->options->legendSymbolGleamSize = .9;
$graph->renderer->options->legendSymbolGleamColor = '#FFFFFF';
$graph->driver = new ezcGraphCairoDriver();
$graph->render( 400, 150, 'tutorial_driver_cairo.png' );
?>
@@ -0,0 +1,31 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->title = 'Access statistics';
$graph->legend = false;
$graph->driver = new ezcGraphFlashDriver();
$graph->options->font = 'tutorial_font.fdb';
$graph->driver->options->compression = 7;
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
'Mozilla' => 19113,
'Explorer' => 10917,
'Opera' => 1464,
'Safari' => 652,
'Konqueror' => 474,
) );
$graph->renderer = new ezcGraphRenderer3d();
$graph->renderer->options->pieChartShadowSize = 10;
$graph->renderer->options->pieChartGleam = .5;
$graph->renderer->options->dataBorder = false;
$graph->renderer->options->pieChartHeight = 16;
$graph->renderer->options->legendSymbolGleam = .5;
$graph->render( 400, 200, 'tutorial_driver_flash.swf' );
?>
@@ -0,0 +1,33 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEzGreen();
$graph->title = 'Access statistics';
$graph->legend = false;
$graph->driver = new ezcGraphGdDriver();
$graph->options->font = 'tutorial_font.ttf';
// Generate a Jpeg with lower quality. The default settings result in a image
// with better quality.
//
// The reduction of the supersampling to 1 will result in no anti aliasing of
// the image. JPEG is not the optimal format for grapics, PNG is far better for
// this kind of images.
$graph->driver->options->supersampling = 1;
$graph->driver->options->jpegQuality = 100;
$graph->driver->options->imageFormat = IMG_JPEG;
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
'Mozilla' => 19113,
'Explorer' => 10917,
'Opera' => 1464,
'Safari' => 652,
'Konqueror' => 474,
) );
$graph->render( 400, 200, 'tutorial_driver_gd.jpg' );
?>
@@ -0,0 +1,31 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->background->color = '#FFFFFFFF';
$graph->title = 'Access statistics';
$graph->legend = false;
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
'Mozilla' => 19113,
'Explorer' => 10917,
'Opera' => 1464,
'Safari' => 652,
'Konqueror' => 474,
) );
$graph->renderer = new ezcGraphRenderer3d();
$graph->renderer->options->pieChartShadowSize = 10;
$graph->renderer->options->pieChartGleam = .5;
$graph->renderer->options->dataBorder = false;
$graph->renderer->options->pieChartHeight = 16;
$graph->renderer->options->legendSymbolGleam = .5;
$graph->driver->options->templateDocument = dirname( __FILE__ ) . '/template.svg';
$graph->driver->options->graphOffset = new ezcGraphCoordinate( 25, 40 );
$graph->driver->options->insertIntoGroup = 'ezcGraph';
$graph->render( 400, 200, 'tutorial_driver_svg.svg' );
?>
@@ -0,0 +1,23 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEz();
$graph->title = 'Access statistics';
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
'Mozilla' => 19113,
'Explorer' => 10917,
'Opera' => 1464,
'Safari' => 652,
'Konqueror' => 474,
) );
$graph->legend->position = ezcGraph::BOTTOM;
$graph->legend->landscapeSize = .3;
$graph->legend->title = 'Legend';
$graph->render( 400, 150, 'tutorial_legend_options.svg' );
?>
@@ -0,0 +1,17 @@
<?php
require_once 'tutorial_autoload.php';
$wikidata = include 'tutorial_wikipedia_data.php';
$graph = new ezcGraphLineChart();
$graph->title = 'Wikipedia articles';
// Add data
foreach ( $wikidata as $language => $data )
{
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
}
$graph->render( 400, 150, 'tutorial_line_chart.svg' );
?>
@@ -0,0 +1,28 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphLineChart();
$graph->title = 'Some random data';
$graph->legend->position = ezcGraph::BOTTOM;
$graph->options->fillLines = 210;
$graph->xAxis = new ezcGraphChartElementNumericAxis();
$data = array();
for ( $i = 0; $i <= 10; $i++ )
{
$data[$i] = mt_rand( -5, 5 );
}
// Add data
$graph->data['random data'] = $dataset = new ezcGraphArrayDataSet( $data );
$average = new ezcGraphDataSetAveragePolynom( $dataset, 3 );
$graph->data[(string) $average->getPolynom()] = $average;
$graph->renderer = new ezcGraphRenderer3d();
$graph->render( 400, 150, 'tutorial_line_chart_3d.svg' );
?>
@@ -0,0 +1,33 @@
<?php
require_once 'tutorial_autoload.php';
$wikidata = include 'tutorial_wikipedia_data.php';
$graph = new ezcGraphLineChart();
$graph->title = 'Wikipedia articles';
// Add data
foreach ( $wikidata as $language => $data )
{
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
}
$graph->yAxis->min = 0;
// Use a different axis for the norwegian dataset
$graph->additionalAxis['norwegian'] = $nAxis = new ezcGraphChartElementNumericAxis();
$nAxis->position = ezcGraph::BOTTOM;
$nAxis->chartPosition = 1;
$nAxis->min = 0;
$graph->data['Norwegian']->yAxis = $nAxis;
// Still use the marker
$graph->additionalAxis['border'] = $marker = new ezcGraphChartElementNumericAxis();
$marker->position = ezcGraph::LEFT;
$marker->chartPosition = 1 / 3;
$graph->render( 400, 150, 'tutorial_line_chart_additional_axis.svg' );
?>
@@ -0,0 +1,23 @@
<?php
require_once 'tutorial_autoload.php';
$wikidata = include 'tutorial_wikipedia_data.php';
$graph = new ezcGraphLineChart();
$graph->title = 'Wikipedia articles';
// Add data
foreach ( $wikidata as $language => $data )
{
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
}
$graph->additionalAxis['border'] = $marker = new ezcGraphChartElementNumericAxis( );
$marker->position = ezcGraph::LEFT;
$marker->chartPosition = 1 / 3;
$marker->label = 'One million!';
$graph->render( 400, 150, 'tutorial_line_chart_markers.svg' );
?>
@@ -0,0 +1,22 @@
<?php
require_once 'tutorial_autoload.php';
require_once 'tutorial_custom_palette.php';
$wikidata = include 'tutorial_wikipedia_data.php';
$graph = new ezcGraphBarChart();
$graph->palette = new tutorialCustomPalette();
$graph->title = 'Wikipedia articles';
// Add data
foreach ( $wikidata as $language => $data )
{
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
}
$graph->data['German']->displayType = ezcGraph::LINE;
$graph->options->fillLines = 210;
$graph->render( 400, 150, 'tutorial_modified_palette.svg' );
?>
@@ -0,0 +1,16 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphOdometerChart();
$graph->title = 'Sample odometer';
$graph->options->font->maxFontSize = 12;
$graph->data['data'] = new ezcGraphArrayDataSet(
array( 1, 3, 9 )
);
$graph->render( 400, 150, 'tutorial_odometer_chart.svg' );
?>
@@ -0,0 +1,19 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->title = 'Access statistics';
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
'Mozilla' => 19113,
'Explorer' => 10917,
'Opera' => 1464,
'Safari' => 652,
'Konqueror' => 474,
) );
$graph->data['Access statistics']->highlight['Opera'] = true;
$graph->renderToOutput( 400, 150 );
?>
@@ -0,0 +1,42 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEzRed();
$graph->title = 'Access statistics';
$graph->options->label = '%2$d (%3$.1f%%)';
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
'Mozilla' => 19113,
'Explorer' => 10917,
'Opera' => 1464,
'Safari' => 652,
'Konqueror' => 474,
) );
$graph->data['Access statistics']->highlight['Explorer'] = true;
$graph->renderer = new ezcGraphRenderer3d();
$graph->renderer->options->moveOut = .2;
$graph->renderer->options->pieChartOffset = 63;
$graph->renderer->options->pieChartGleam = .3;
$graph->renderer->options->pieChartGleamColor = '#FFFFFF';
$graph->renderer->options->pieChartShadowSize = 5;
$graph->renderer->options->pieChartShadowColor = '#000000';
$graph->renderer->options->legendSymbolGleam = .5;
$graph->renderer->options->legendSymbolGleamSize = .9;
$graph->renderer->options->legendSymbolGleamColor = '#FFFFFF';
$graph->renderer->options->pieChartSymbolColor = '#55575388';
$graph->renderer->options->pieChartHeight = 5;
$graph->renderer->options->pieChartRotation = .8;
$graph->render( 400, 150, 'tutorial_pie_chart_3d.svg' );
?>
@@ -0,0 +1,34 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEzRed();
$graph->title = 'Access statistics';
$graph->legend = false;
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
'Mozilla' => 19113,
'Explorer' => 10917,
'Opera' => 1464,
'Safari' => 652,
'Konqueror' => 474,
) );
$graph->data['Access statistics']->highlight['Explorer'] = true;
// $graph->renderer = new ezcGraphRenderer2d();
$graph->renderer->options->moveOut = .2;
$graph->renderer->options->pieChartOffset = 63;
$graph->renderer->options->pieChartGleam = .3;
$graph->renderer->options->pieChartGleamColor = '#FFFFFF';
$graph->renderer->options->pieChartGleamBorder = 2;
$graph->renderer->options->pieChartShadowSize = 5;
$graph->renderer->options->pieChartShadowColor = '#BABDB6';
$graph->render( 400, 150, 'tutorial_pie_chart_options.svg' );
?>
@@ -0,0 +1,40 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteBlack();
$graph->title = 'Access statistics';
$graph->options->label = '%2$d (%3$.1f%%)';
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
'Mozilla' => 19113,
'Explorer' => 10917,
'Opera' => 1464,
'Safari' => 652,
'Konqueror' => 474,
) );
$graph->data['Access statistics']->highlight['Explorer'] = true;
// $graph->renderer = new ezcGraphRenderer2d();
$graph->renderer->options->moveOut = .2;
$graph->renderer->options->pieChartOffset = 63;
$graph->renderer->options->pieChartGleam = .3;
$graph->renderer->options->pieChartGleamColor = '#FFFFFF';
$graph->renderer->options->pieChartGleamBorder = 2;
$graph->renderer->options->pieChartShadowSize = 3;
$graph->renderer->options->pieChartShadowColor = '#000000';
$graph->renderer->options->legendSymbolGleam = .5;
$graph->renderer->options->legendSymbolGleamSize = .9;
$graph->renderer->options->legendSymbolGleamColor = '#FFFFFF';
$graph->renderer->options->pieChartSymbolColor = '#BABDB688';
$graph->render( 400, 150, 'tutorial_pie_chart_pimped.svg' );
?>
@@ -0,0 +1,25 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->title = 'Elections 2005 Germany';
$graph->data['2005'] = new ezcGraphArrayDataSet( array(
'CDU' => 35.2,
'SPD' => 34.2,
'FDP' => 9.8,
'Die Gruenen' => 8.1,
'PDS' => 8.7,
'NDP' => 1.6,
'REP' => 0.6,
) );
$graph->options->label = '%3$.1f%%';
$graph->options->sum = 100;
$graph->options->percentThreshold = 0.02;
$graph->options->summarizeCaption = 'Others';
$graph->render( 400, 150, 'tutorial_pie_options.svg' );
?>
@@ -0,0 +1,19 @@
<?php
require_once 'tutorial_autoload.php';
$wikidata = include 'tutorial_wikipedia_data.php';
$graph = new ezcGraphRadarChart();
$graph->title = 'Wikipedia articles';
$graph->options->fillLines = 220;
// Add data
foreach ( $wikidata as $language => $data )
{
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
$graph->data[$language][] = reset( $data );
}
$graph->render( 400, 150, 'tutorial_radar_chart.svg' );
?>
@@ -0,0 +1,41 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEzGreen();
$graph->title = 'Access statistics';
$graph->driver = new ezcGraphGdDriver();
$graph->options->font = 'tutorial_font.ttf';
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
'Mozilla' => 19113,
'Explorer' => 10917,
'Opera' => 1464,
'Safari' => 652,
'Konqueror' => 474,
) );
$graph->data['Access statistics']->url = 'http://example.org/';
$graph->data['Access statistics']->url['Mozilla'] = 'http://example.org/mozilla';
$graph->render( 400, 200, 'tutorial_reference_gd.png' );
?>
<html>
<head><title>Image map example</title></head>
<body>
<?php
echo ezcGraphTools::createImageMap( $graph, 'GraphPieChartMap' );
?>
<img
src="tutorial_reference_gd.png"
width="400" height="200"
usemap="#GraphPieChartMap" />
</body>
</html>
<?php
?>
@@ -0,0 +1,25 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEz();
$graph->title = 'Access statistics';
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
'Mozilla' => 19113,
'Explorer' => 10917,
'Opera' => 1464,
'Safari' => 652,
'Konqueror' => 474,
) );
$graph->data['Access statistics']->url = 'http://example.org/';
$graph->data['Access statistics']->url['Mozilla'] = 'http://example.org/mozilla';
$graph->render( 400, 200, 'tutorial_reference_svg.svg' );
$graph->driver->options->linkCursor = 'crosshair';
ezcGraphTools::linkSvgElements( $graph );
?>
@@ -0,0 +1,21 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->title = 'Access statistics';
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
'Mozilla' => 19113,
'Explorer' => 10917,
'Opera' => 1464,
'Safari' => 652,
'Konqueror' => 474,
) );
$graph->data['Access statistics']->highlight['Opera'] = true;
$graph->renderer = new ezcGraphRenderer3d();
$graph->render( 400, 150, 'tutorial_renderer_3d.svg' );
?>
@@ -0,0 +1,24 @@
<?php
require_once 'tutorial_autoload.php';
$wikidata = include 'tutorial_wikipedia_data.php';
$graph = new ezcGraphLineChart();
$graph->title = 'Wikipedia articles';
$graph->xAxis->axisLabelRenderer = new ezcGraphAxisRotatedLabelRenderer();
$graph->xAxis->axisLabelRenderer->angle = 45;
$graph->xAxis->axisSpace = .2;
// Add data
foreach ( $wikidata as $language => $data )
{
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
}
$graph->data['German']->displayType = ezcGraph::LINE;
$graph->options->fillLines = 210;
$graph->render( 400, 150, 'tutorial_rotated_labels.svg' );
?>
@@ -0,0 +1,19 @@
<?php
require_once 'tutorial_autoload.php';
$graph = new ezcGraphPieChart();
$graph->title = 'Access statistics';
$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array(
'Mozilla' => 19113,
'Explorer' => 10917,
'Opera' => 1464,
'Safari' => 652,
'Konqueror' => 474,
) );
$graph->data['Access statistics']->highlight['Opera'] = true;
$graph->render( 400, 150, 'tutorial_simple_pie.svg' );
?>
@@ -0,0 +1,22 @@
<?php
require_once 'tutorial_autoload.php';
$wikidata = include 'tutorial_wikipedia_data.php';
$graph = new ezcGraphBarChart();
$graph->title = 'Wikipedia articles';
// Stack bars
$graph->options->stackBars = true;
// Add data
foreach ( $wikidata as $language => $data )
{
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
}
$graph->yAxis->label = 'Thousand articles';
$graph->render( 400, 150, 'tutorial_stacked_bar_chart.svg' );
?>
@@ -0,0 +1,21 @@
<?php
require_once 'tutorial_autoload.php';
$wikidata = include 'tutorial_wikipedia_data.php';
$graph = new ezcGraphBarChart();
$graph->palette = new ezcGraphPaletteBlack();
$graph->title = 'Wikipedia articles';
// Add data
foreach ( $wikidata as $language => $data )
{
$graph->data[$language] = new ezcGraphArrayDataSet( $data );
}
$graph->data['German']->displayType = ezcGraph::LINE;
$graph->options->fillLines = 210;
$graph->render( 400, 150, 'tutorial_user_palette.svg' );
?>
@@ -0,0 +1,30 @@
<?php
return array(
'English' => array(
'Jan 2006' => 965,
'Feb 2006' => 1000,
'Mar 2006' => 1100,
'Apr 2006' => 1100,
'May 2006' => 1200,
'Jun 2006' => 1300,
),
'German' => array(
'Jan 2006' => 357,
'Feb 2006' => 371,
'Mar 2006' => 387,
'Apr 2006' => 402,
'May 2006' => 429,
'Jun 2006' => 435,
),
'Norwegian' => array(
'Jan 2006' => 49,
'Feb 2006' => 52,
'Mar 2006' => 56,
'Apr 2006' => 59,
'May 2006' => 63,
'Jun 2006' => 67,
),
);
?>