diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-11-29 11:44:25 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-11-29 11:44:25 +0000 |
commit | b258b0538e0b11e0ed8419035655f2e55e86a98c (patch) | |
tree | 00239e111309e549aa112206d9569e778fff5bef | |
parent | 1673ab83ff6be88690d4f1fb404d01058d181f4e (diff) | |
download | zetacomponents-graph-b258b0538e0b11e0ed8419035655f2e55e86a98c.zip zetacomponents-graph-b258b0538e0b11e0ed8419035655f2e55e86a98c.tar.gz |
- Increased example numbers
-rw-r--r-- | docs/img/tutorial_example_25.svg.png (renamed from docs/img/tutorial_example_24.svg.png) | bin | 72895 -> 72895 bytes | |||
-rw-r--r-- | docs/img/tutorial_example_26.jpg (renamed from docs/img/tutorial_example_25.jpg) | bin | 37275 -> 37275 bytes | |||
-rw-r--r-- | docs/img/tutorial_example_27.swf (renamed from docs/img/tutorial_example_26.swf) | bin | 35265 -> 35265 bytes | |||
-rw-r--r-- | docs/img/tutorial_example_28.svg (renamed from docs/img/tutorial_example_27.svg) | 0 | ||||
-rw-r--r-- | docs/img/tutorial_example_29.html (renamed from docs/img/tutorial_example_28.html) | 0 | ||||
-rw-r--r-- | docs/img/tutorial_example_29.png (renamed from docs/img/tutorial_example_28.png) | bin | 52161 -> 52161 bytes | |||
-rw-r--r-- | docs/tutorial_example_24.php | 31 | ||||
-rw-r--r-- | docs/tutorial_example_25.php | 22 | ||||
-rw-r--r-- | docs/tutorial_example_26.php | 18 | ||||
-rw-r--r-- | docs/tutorial_example_27.php | 52 | ||||
-rw-r--r-- | docs/tutorial_example_28.php | 71 | ||||
-rw-r--r-- | docs/tutorial_example_29.php | 58 |
12 files changed, 126 insertions, 126 deletions
diff --git a/docs/img/tutorial_example_24.svg.png b/docs/img/tutorial_example_25.svg.png Binary files differindex 04427d4..04427d4 100644 --- a/docs/img/tutorial_example_24.svg.png +++ b/docs/img/tutorial_example_25.svg.png diff --git a/docs/img/tutorial_example_25.jpg b/docs/img/tutorial_example_26.jpg Binary files differindex 33e84d9..33e84d9 100644 --- a/docs/img/tutorial_example_25.jpg +++ b/docs/img/tutorial_example_26.jpg diff --git a/docs/img/tutorial_example_26.swf b/docs/img/tutorial_example_27.swf Binary files differindex 3dbb2e0..3dbb2e0 100644 --- a/docs/img/tutorial_example_26.swf +++ b/docs/img/tutorial_example_27.swf diff --git a/docs/img/tutorial_example_27.svg b/docs/img/tutorial_example_28.svg index 0967b19..0967b19 100644 --- a/docs/img/tutorial_example_27.svg +++ b/docs/img/tutorial_example_28.svg diff --git a/docs/img/tutorial_example_28.html b/docs/img/tutorial_example_29.html index 92471dd..92471dd 100644 --- a/docs/img/tutorial_example_28.html +++ b/docs/img/tutorial_example_29.html diff --git a/docs/img/tutorial_example_28.png b/docs/img/tutorial_example_29.png Binary files differindex 4ecaa52..4ecaa52 100644 --- a/docs/img/tutorial_example_28.png +++ b/docs/img/tutorial_example_29.png diff --git a/docs/tutorial_example_24.php b/docs/tutorial_example_24.php deleted file mode 100644 index bee8f6a..0000000 --- a/docs/tutorial_example_24.php +++ /dev/null @@ -1,31 +0,0 @@ -<?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 = 'template.svg'; -$graph->driver->options->graphOffset = new ezcGraphCoordinate( 25, 40 ); -$graph->driver->options->insertIntoGroup = 'ezcGraph'; - -$graph->render( 400, 200, 'tutorial_example_24.svg' ); - -?> diff --git a/docs/tutorial_example_25.php b/docs/tutorial_example_25.php index 1f728e8..bee8f6a 100644 --- a/docs/tutorial_example_25.php +++ b/docs/tutorial_example_25.php @@ -3,17 +3,10 @@ require_once 'tutorial_autoload.php'; $graph = new ezcGraphPieChart(); -$graph->palette = new ezcGraphPaletteEzGreen(); +$graph->background->color = '#FFFFFFFF'; $graph->title = 'Access statistics'; $graph->legend = false; -$graph->driver = new ezcGraphGdDriver(); -$graph->options->font = 'tutorial_font.ttf'; - -$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, @@ -22,6 +15,17 @@ $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( 'Konqueror' => 474, ) ); -$graph->render( 400, 200, 'tutorial_example_25.jpg' ); +$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 = 'template.svg'; +$graph->driver->options->graphOffset = new ezcGraphCoordinate( 25, 40 ); +$graph->driver->options->insertIntoGroup = 'ezcGraph'; + +$graph->render( 400, 200, 'tutorial_example_24.svg' ); ?> diff --git a/docs/tutorial_example_26.php b/docs/tutorial_example_26.php index 9bb9f50..1f728e8 100644 --- a/docs/tutorial_example_26.php +++ b/docs/tutorial_example_26.php @@ -3,13 +3,16 @@ require_once 'tutorial_autoload.php'; $graph = new ezcGraphPieChart(); +$graph->palette = new ezcGraphPaletteEzGreen(); $graph->title = 'Access statistics'; $graph->legend = false; -$graph->driver = new ezcGraphMingDriver(); -$graph->options->font = 'tutorial_font.fdb'; +$graph->driver = new ezcGraphGdDriver(); +$graph->options->font = 'tutorial_font.ttf'; -$graph->driver->options->compression = 7; +$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, @@ -19,13 +22,6 @@ $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( '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_example_26.swf' ); +$graph->render( 400, 200, 'tutorial_example_25.jpg' ); ?> diff --git a/docs/tutorial_example_27.php b/docs/tutorial_example_27.php index 4843b9b..9bb9f50 100644 --- a/docs/tutorial_example_27.php +++ b/docs/tutorial_example_27.php @@ -3,8 +3,13 @@ require_once 'tutorial_autoload.php'; $graph = new ezcGraphPieChart(); -$graph->palette = new ezcGraphPaletteEz(); $graph->title = 'Access statistics'; +$graph->legend = false; + +$graph->driver = new ezcGraphMingDriver(); +$graph->options->font = 'tutorial_font.fdb'; + +$graph->driver->options->compression = 7; $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( 'Mozilla' => 19113, @@ -14,42 +19,13 @@ $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( 'Konqueror' => 474, ) ); -$graph->render( 400, 200, 'tutorial_example_27.svg' ); - -// Get element references from renderer -$elements = $graph->renderer->getElementReferences(); - -// Add links to charts -$dom = new DOMDocument(); -$dom->load( 'tutorial_example_27.svg' ); -$xpath = new DomXPath( $dom ); - -// Link chart elements -foreach( $elements['data']['Access statistics'] as $objectName => $ids ) -{ - foreach( $ids as $id ) - { - echo "Link: $id\n"; - $element = $xpath->query( '//*[@id = \'' . $id . '\']' )->item( 0 ); - - $element->setAttribute( 'style', $element->getAttribute( 'style' ) . ' cursor: pointer;' ); - $element->setAttribute( 'onclick', 'top.location = \'/detailedData.php?browser=' . $objectName . '\'' ); - } -} - -// Link legend elements -foreach( $elements['legend'] as $objectName => $ids ) -{ - foreach( $ids as $id ) - { - echo "Link: $id\n"; - $element = $xpath->query( '//*[@id = \'' . $id . '\']' )->item( 0 ); - - $element->setAttribute( 'style', $element->getAttribute( 'style' ) . ' cursor: pointer;' ); - $element->setAttribute( 'onclick', 'top.location = \'/detailedData.php?browser=' . $objectName . '\'' ); - } -} - -$dom->save( 'tutorial_example_27.svg' ); +$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_example_26.swf' ); ?> diff --git a/docs/tutorial_example_28.php b/docs/tutorial_example_28.php index bc1920d..4843b9b 100644 --- a/docs/tutorial_example_28.php +++ b/docs/tutorial_example_28.php @@ -3,12 +3,9 @@ require_once 'tutorial_autoload.php'; $graph = new ezcGraphPieChart(); -$graph->palette = new ezcGraphPaletteEzGreen(); +$graph->palette = new ezcGraphPaletteEz(); $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, @@ -17,42 +14,42 @@ $graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( 'Konqueror' => 474, ) ); -$graph->render( 400, 200, 'tutorial_example_28.png' ); +$graph->render( 400, 200, 'tutorial_example_27.svg' ); +// Get element references from renderer $elements = $graph->renderer->getElementReferences(); -?> -<html> - <head><title>Image map example</title></head> - <body> - <map - name="ezcGraphPieChartMap"> -<?php - foreach ( $elements['legend'] as $objectName => $polygones ) +// Add links to charts +$dom = new DOMDocument(); +$dom->load( 'tutorial_example_27.svg' ); +$xpath = new DomXPath( $dom ); + +// Link chart elements +foreach( $elements['data']['Access statistics'] as $objectName => $ids ) +{ + foreach( $ids as $id ) { - foreach ( $polygones as $shape => $polygone ) - { - $coordinateString = ''; - foreach( $polygone as $coordinate ) - { - $coordinateString .= sprintf( '%d,%d,', $coordinate->x, $coordinate->y ); - } - - printf( "<area shape=\"poly\" coords=\"%s\" href=\"/detailedData.php?browser=%s\" alt=\"%s: %s\" title=\"%s: %s\" />\n", - substr( $coordinateString, 0, -1 ), - $objectName, - $shape, $objectName, - $shape, $objectName - ); - } + echo "Link: $id\n"; + $element = $xpath->query( '//*[@id = \'' . $id . '\']' )->item( 0 ); + + $element->setAttribute( 'style', $element->getAttribute( 'style' ) . ' cursor: pointer;' ); + $element->setAttribute( 'onclick', 'top.location = \'/detailedData.php?browser=' . $objectName . '\'' ); } -?> - </map> - <img - src="tutorial_example_28.png" - width="400" height="200" - usemap="#ezcGraphPieChartMap" - </body> -</html> -<?php +} + +// Link legend elements +foreach( $elements['legend'] as $objectName => $ids ) +{ + foreach( $ids as $id ) + { + echo "Link: $id\n"; + $element = $xpath->query( '//*[@id = \'' . $id . '\']' )->item( 0 ); + + $element->setAttribute( 'style', $element->getAttribute( 'style' ) . ' cursor: pointer;' ); + $element->setAttribute( 'onclick', 'top.location = \'/detailedData.php?browser=' . $objectName . '\'' ); + } +} + +$dom->save( 'tutorial_example_27.svg' ); + ?> diff --git a/docs/tutorial_example_29.php b/docs/tutorial_example_29.php new file mode 100644 index 0000000..bc1920d --- /dev/null +++ b/docs/tutorial_example_29.php @@ -0,0 +1,58 @@ +<?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->render( 400, 200, 'tutorial_example_28.png' ); + +$elements = $graph->renderer->getElementReferences(); + +?> +<html> + <head><title>Image map example</title></head> + <body> + <map + name="ezcGraphPieChartMap"> +<?php + foreach ( $elements['legend'] as $objectName => $polygones ) + { + foreach ( $polygones as $shape => $polygone ) + { + $coordinateString = ''; + foreach( $polygone as $coordinate ) + { + $coordinateString .= sprintf( '%d,%d,', $coordinate->x, $coordinate->y ); + } + + printf( "<area shape=\"poly\" coords=\"%s\" href=\"/detailedData.php?browser=%s\" alt=\"%s: %s\" title=\"%s: %s\" />\n", + substr( $coordinateString, 0, -1 ), + $objectName, + $shape, $objectName, + $shape, $objectName + ); + } + } +?> + </map> + <img + src="tutorial_example_28.png" + width="400" height="200" + usemap="#ezcGraphPieChartMap" + </body> +</html> +<?php +?> |