diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-10-26 16:06:37 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-10-26 16:06:37 +0000 |
commit | 63399c71690adb48721726697e08b73c05f1e484 (patch) | |
tree | 8abd82f70e8ced98870989bf90ba5b5626a07385 | |
parent | 2bd43bb5d0a869a10accb3202c7599f377c738e4 (diff) | |
download | zetacomponents-graph-63399c71690adb48721726697e08b73c05f1e484.zip zetacomponents-graph-63399c71690adb48721726697e08b73c05f1e484.tar.gz |
- Added two new palettes (ezGreen and ezRed)
- Added more examples for newsletter
-rw-r--r-- | docs/examples/forum_evolution.php | 51 | ||||
-rw-r--r-- | docs/examples/forum_month.php | 48 | ||||
-rw-r--r-- | docs/examples/forum_weekly.php (renamed from docs/examples/forum.php) | 2 | ||||
-rw-r--r-- | docs/examples/forum_year.php | 46 | ||||
-rw-r--r-- | src/graph_autoload.php | 2 | ||||
-rw-r--r-- | src/palette/ez_green.php | 82 | ||||
-rw-r--r-- | src/palette/ez_red.php | 82 |
7 files changed, 312 insertions, 1 deletions
diff --git a/docs/examples/forum_evolution.php b/docs/examples/forum_evolution.php new file mode 100644 index 0000000..760e1d3 --- /dev/null +++ b/docs/examples/forum_evolution.php @@ -0,0 +1,51 @@ +<?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'; + +// Use fdb font for ming driver +$graph->options->font = dirname( __FILE__ ) . '/../../tests/data/fdb_font.fdb'; + +// Add the data and hilight norwegian data set +$graph->data['Posts'] = new ezcGraphArrayDataSet( array( + 'May 2006' => 1164, + 'June 2006' => 965, + 'July 2006' => 1014, + 'August 2006' => 1269, + 'September 2006' => 1269, + 'October 2006' => 771, +) ); + +$graph->data['per day'] = new ezcGraphArrayDataSet( array( + 'May 2006' => 38, + 'June 2006' => 32, + 'July 2006' => 33, + 'August 2006' => 41, + 'September 2006' => 34, + 'October 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 ezcGraphMingDriver(); + +// Output the graph with std SVG driver +$graph->render( 500, 200, 'forum_evolution.swf' ); + +?> diff --git a/docs/examples/forum_month.php b/docs/examples/forum_month.php new file mode 100644 index 0000000..1cf6a21 --- /dev/null +++ b/docs/examples/forum_month.php @@ -0,0 +1,48 @@ +<?php + +require 'Base/src/base.php'; +function __autoload( $className ) +{ + ezcBase::autoload( $className ); +} + +// Create the graph +$graph = new ezcGraphPieChart(); +$graph->palette = new ezcGraphPaletteEzRed(); +$graph->legend = false; + +// Use fdb font for ming driver +$graph->options->font = dirname( __FILE__ ) . '/../../tests/data/fdb_font.fdb'; + +// 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->renderer->options->pieChartSymbolColor = '#88888888'; + +$graph->driver = new ezcGraphMingDriver(); + +// Output the graph with std SVG driver +$graph->render( 500, 200, 'forum_month.swf' ); + +?> diff --git a/docs/examples/forum.php b/docs/examples/forum_weekly.php index 24890f1..041fadc 100644 --- a/docs/examples/forum.php +++ b/docs/examples/forum_weekly.php @@ -44,6 +44,6 @@ $graph->renderer->options->pieChartSymbolColor = '#88888888'; $graph->driver = new ezcGraphMingDriver(); // Output the graph with std SVG driver -$graph->render( 500, 200, 'forum.swf' ); +$graph->render( 500, 200, 'forum_weekly.swf' ); ?> diff --git a/docs/examples/forum_year.php b/docs/examples/forum_year.php new file mode 100644 index 0000000..03e48e8 --- /dev/null +++ b/docs/examples/forum_year.php @@ -0,0 +1,46 @@ +<?php + +require 'Base/src/base.php'; +function __autoload( $className ) +{ + ezcBase::autoload( $className ); +} + +// Create the graph +$graph = new ezcGraphPieChart(); +$graph->palette = new ezcGraphPaletteEzGreen(); +$graph->legend = false; + +// Use fdb font for ming driver +$graph->options->font = dirname( __FILE__ ) . '/../../tests/data/fdb_font.fdb'; + +// 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->renderer->options->pieChartSymbolColor = '#88888888'; + +$graph->driver = new ezcGraphMingDriver(); + +// Output the graph with std SVG driver +$graph->render( 500, 200, 'forum_year.swf' ); + +?> diff --git a/src/graph_autoload.php b/src/graph_autoload.php index deb6f92..618491b 100644 --- a/src/graph_autoload.php +++ b/src/graph_autoload.php @@ -64,6 +64,8 @@ return array( 'ezcGraphPaletteTango' => 'Graph/palette/tango.php', 'ezcGraphPaletteBlack' => 'Graph/palette/black.php', 'ezcGraphPaletteEzBlue' => 'Graph/palette/ez_blue.php', + 'ezcGraphPaletteEzGreen' => 'Graph/palette/ez_green.php', + 'ezcGraphPaletteEzRed' => 'Graph/palette/ez_red.php', 'ezcGraphPaletteEz' => 'Graph/palette/ez.php', 'ezcGraphChartElement' => 'Graph/interfaces/element.php', diff --git a/src/palette/ez_green.php b/src/palette/ez_green.php new file mode 100644 index 0000000..8774970 --- /dev/null +++ b/src/palette/ez_green.php @@ -0,0 +1,82 @@ +<?php +/** + * File containing the ezcGraphPaletteEzGreen class + * + * @package Graph + * @version //autogentag// + * @copyright Copyright (C) 2005, 2006 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; +} + +?> diff --git a/src/palette/ez_red.php b/src/palette/ez_red.php new file mode 100644 index 0000000..bd4d731 --- /dev/null +++ b/src/palette/ez_red.php @@ -0,0 +1,82 @@ +<?php +/** + * File containing the ezcGraphPaletteEzRed class + * + * @package Graph + * @version //autogentag// + * @copyright Copyright (C) 2005, 2006 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; +} + +?> |