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
@@ -0,0 +1,82 @@
<?php
/**
* File containing the ezcGraphPaletteEzGreen class
*
* @package Graph
* @version 1.3
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
* @license http://ez.no/licenses/new_bsd New BSD License
*/
/**
* Light green color pallet for ezcGraph based on green eZ colors
*
* @package Graph
*/
class ezcGraphPaletteEzGreen extends ezcGraphPalette
{
/**
* Axiscolor
*
* @var ezcGraphColor
*/
protected $axisColor = '#2E3436';
/**
* Array with colors for datasets
*
* @var array
*/
protected $dataSetColor = array(
'#9CAE86',
'#87B06B',
'#5C9A75',
'#467A6E',
'#4F6C57',
);
/**
* Array with symbols for datasets
*
* @var array
*/
protected $dataSetSymbol = array(
ezcGraph::BULLET,
);
/**
* Name of font to use
*
* @var string
*/
protected $fontName = 'sans-serif';
/**
* Fontcolor
*
* @var ezcGraphColor
*/
protected $fontColor = '#2E3436';
/**
* Backgroundcolor for chart
*
* @var ezcGraphColor
*/
protected $chartBackground = '#FFFFFF';
/**
* Padding in elements
*
* @var integer
*/
protected $padding = 1;
/**
* Margin of elements
*
* @var integer
*/
protected $margin = 0;
}
?>
@@ -0,0 +1,82 @@
<?php
/**
* File containing the ezcGraphPaletteEzRed class
*
* @package Graph
* @version 1.3
* @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
* @license http://ez.no/licenses/new_bsd New BSD License
*/
/**
* Light red color pallet for ezcGraph based on red eZ colors
*
* @package Graph
*/
class ezcGraphPaletteEzRed extends ezcGraphPalette
{
/**
* Axiscolor
*
* @var ezcGraphColor
*/
protected $axisColor = '#2E3436';
/**
* Array with colors for datasets
*
* @var array
*/
protected $dataSetColor = array(
'#B50D2C',
'#C42926',
'#C34009',
'#CA3C04',
'#D86300',
);
/**
* Array with symbols for datasets
*
* @var array
*/
protected $dataSetSymbol = array(
ezcGraph::BULLET,
);
/**
* Name of font to use
*
* @var string
*/
protected $fontName = 'sans-serif';
/**
* Fontcolor
*
* @var ezcGraphColor
*/
protected $fontColor = '#2E3436';
/**
* Backgroundcolor for chart
*
* @var ezcGraphColor
*/
protected $chartBackground = '#FFFFFF';
/**
* Padding in elements
*
* @var integer
*/
protected $padding = 1;
/**
* Margin of elements
*
* @var integer
*/
protected $margin = 0;
}
?>
@@ -0,0 +1,48 @@
<?php
require 'Base/src/base.php';
function __autoload( $className )
{
ezcBase::autoload( $className );
}
// Create the graph
$graph = new ezcGraphBarChart();
$graph->palette = new ezcGraphPaletteEzBlue();
$graph->xAxis->majorGrid = '#888888';
$graph->yAxis->majorGrid = '#888888';
// Add the data and hilight norwegian data set
$graph->data['Posts'] = new ezcGraphArrayDataSet( array(
'May 2006' => 1164,
'Jun 2006' => 965,
'Jul 2006' => 1014,
'Aug 2006' => 1269,
'Sep 2006' => 1269,
'Oct 2006' => 771,
) );
$graph->data['per day'] = new ezcGraphArrayDataSet( array(
'May 2006' => 38,
'Jun 2006' => 32,
'Jul 2006' => 33,
'Aug 2006' => 41,
'Sep 2006' => 34,
'Oct 2006' => 25,
) );
// Set graph title
$graph->title = 'Forum posts in last months';
// Use 3d renderer, and beautify it
$graph->renderer = new ezcGraphRenderer3d();
$graph->renderer->options->barChartGleam = .5;
$graph->renderer->options->legendSymbolGleam = .5;
$graph->driver = new ezcGraphSvgDriver();
// Output the graph with std SVG driver
$graph->render( 500, 200, 'forum_evolution.svg' );
?>
@@ -0,0 +1,47 @@
<?php
require 'Base/src/base.php';
function __autoload( $className )
{
ezcBase::autoload( $className );
}
// Require custom palette
require dirname( __FILE__ ) . '/ez_red.php';
// Create the graph
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEzRed();
$graph->legend = false;
// Add the data and hilight norwegian data set
$graph->data['week'] = new ezcGraphArrayDataSet( array(
'Claudia Kosny' => 128,
'Kristof Coomans' => 70,
'Xavier Dutoit' => 64,
'David Jones' => 58,
'Lukasz Serwatka' => 45,
'Norman Leutner' => 22,
'Marko Zmak' => 20,
'sangib das' => 20,
'Nabil Alimi' => 19,
) );
// Set graph title
$graph->title = '10 most active users on forum in last month';
// Use 3d renderer, and beautify it
$graph->renderer = new ezcGraphRenderer3d();
$graph->renderer->options->pieChartShadowSize = 12;
$graph->renderer->options->pieChartGleam = .5;
$graph->renderer->options->dataBorder = false;
$graph->renderer->options->pieChartHeight = 16;
$graph->renderer->options->legendSymbolGleam = .5;
$graph->renderer->options->pieChartOffset = 100;
$graph->driver = new ezcGraphSvgDriver();
// Output the graph with std SVG driver
$graph->render( 500, 200, 'forum_month.svg' );
?>
@@ -0,0 +1,45 @@
<?php
require 'Base/src/base.php';
function __autoload( $className )
{
ezcBase::autoload( $className );
}
// Create the graph
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEzBlue();
$graph->legend = false;
// Add the data and hilight norwegian data set
$graph->data['week'] = new ezcGraphArrayDataSet( array(
'Claudia Kosny' => 45,
'Lukasz Serwatka' => 35,
'Kristof Coomans' => 25,
'David Jones' => 23,
'Xavier Dutoit' => 20,
'sangib das' => 14,
'Mark Marsiglio' => 10,
'mark hayhurst' => 10,
'Paul Borgermans' => 10,
'Nabil Alimi' => 9,
) );
// Set graph title
$graph->title = '10 most active users on forum in last week';
// Use 3d renderer, and beautify it
$graph->renderer = new ezcGraphRenderer3d();
$graph->renderer->options->pieChartShadowSize = 12;
$graph->renderer->options->pieChartGleam = .5;
$graph->renderer->options->dataBorder = false;
$graph->renderer->options->pieChartHeight = 16;
$graph->renderer->options->legendSymbolGleam = .5;
$graph->renderer->options->pieChartOffset = 100;
$graph->driver = new ezcGraphSvgDriver();
// Output the graph with std SVG driver
$graph->render( 500, 200, 'forum_weekly.svg' );
?>
@@ -0,0 +1,45 @@
<?php
require 'Base/src/base.php';
function __autoload( $className )
{
ezcBase::autoload( $className );
}
// Require custom palette
require dirname( __FILE__ ) . '/ez_green.php';
// Create the graph
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEzGreen();
$graph->legend = false;
// Add the data and hilight norwegian data set
$graph->data['week'] = new ezcGraphArrayDataSet( array(
'Lukasz Serwatka' => 1805,
'Paul Forsyth' => 1491,
'Paul Borgermans' => 1316,
'Kristof Coomans' => 956,
'Alex Jones' => 942 ,
'Bard Farstad' => 941,
'Tony Wood' => 900,
) );
// Set graph title
$graph->title = 'Alltime 10 most active users on forum';
// Use 3d renderer, and beautify it
$graph->renderer = new ezcGraphRenderer3d();
$graph->renderer->options->pieChartShadowSize = 12;
$graph->renderer->options->pieChartGleam = .5;
$graph->renderer->options->dataBorder = false;
$graph->renderer->options->pieChartHeight = 16;
$graph->renderer->options->legendSymbolGleam = .5;
$graph->renderer->options->pieChartOffset = 100;
$graph->driver = new ezcGraphSvgDriver();
// Output the graph with std SVG driver
$graph->render( 500, 200, 'forum_year.svg' );
?>
@@ -0,0 +1,45 @@
<?php
require 'Base/src/base.php';
function __autoload( $className )
{
ezcBase::autoload( $className );
}
// Create the graph
$graph = new ezcGraphPieChart();
$graph->palette = new ezcGraphPaletteEzRed();
// Add the data and hilight norwegian data set
$graph->data['articles'] = new ezcGraphArrayDataSet( array(
'English' => 1300000,
'Germany' => 452000,
'Netherlands' => 217000,
'Norway' => 70000,
) );
$graph->data['articles']->highlight['Germany'] = true;
// Set graph title
$graph->title = 'Wikipedia articles by country';
// Modify pie chart label to only show amount and percent
$graph->options->label = '%2$d (%3$.1f%%)';
// Use 3d renderer, and beautify it
$graph->renderer = new ezcGraphRenderer3d();
$graph->renderer->options->pieChartShadowSize = 12;
$graph->renderer->options->pieChartGleam = .5;
$graph->renderer->options->dataBorder = false;
$graph->renderer->options->pieChartHeight = 8;
$graph->renderer->options->pieChartRotation = .8;
$graph->renderer->options->pieChartOffset = 190;
$graph->renderer->options->legendSymbolGleam = .5;
// Output the graph with std SVG driver
$graph->render( 400, 200, 'wikipedia.svg' );
?>
@@ -0,0 +1,39 @@
<?php
require 'Base/src/base.php';
function __autoload( $className )
{
ezcBase::autoload( $className );
}
// Create the graph
$graph = new ezcGraphPieChart();
// Add the data and hilight norwegian data set
$graph->data['articles'] = new ezcGraphArrayDataSet( array(
'English' => 1300000,
'Germany' => 452000,
'Netherlands' => 217000,
'Norway' => 70000,
) );
$graph->data['articles']->highlight['Norway'] = true;
// Set graph title
$graph->title = 'Articles by country';
// Modify pie chart label to only show amount and percent
$graph->options->label = '%2$d (%3$.1f%%)';
// Use 3d renderer, and beautify it
$graph->renderer = new ezcGraphRenderer3d();
$graph->renderer->options->pieChartShadowSize = 12;
$graph->renderer->options->pieChartGleam = .5;
$graph->renderer->options->dataBorder = false;
$graph->renderer->options->pieChartHeight = 16;
$graph->renderer->options->legendSymbolGleam = .5;
$graph->renderer->options->pieChartOffset = 100;
// Output the graph with std SVG driver
$graph->render( 500, 200, 'wiki_graph.svg' );
?>