Author: Kore Nordmann
Date: 2007-01-04 12:08:14 +0100 (Thu, 04 Jan 2007)
New Revision: 4465

Log:
- Resolved task #9910: Add "renderToOutput" example to Graph tutorial.

Added:
   trunk/Graph/docs/tutorial_example_30.php
Modified:
   trunk/Graph/docs/tutorial.txt

Modified: trunk/Graph/docs/tutorial.txt
===================================================================
--- trunk/Graph/docs/tutorial.txt       2007-01-04 11:02:35 UTC (rev 4464)
+++ trunk/Graph/docs/tutorial.txt       2007-01-04 11:08:14 UTC (rev 4465)
@@ -895,6 +895,22 @@
 
 __ img/tutorial_example_29.html
 
+Direct output
+=============
+
+By default a graph is rendered to a file, because you normally want to cache
+generated images. ezcGraph also provides a method for direct output of
+generated charts, but use this with caution.
+
+The ezcGraph::renderToOutput() method sends the correct Content-Type header
+for the selected output driver and writes the charts image data directly to
+the output. Pay attention not to output anything before using this method.
+
+.. include:: tutorial_example_30.php
+   :literal:
+
+This example renders the first graph of this tutorial.
+
 More Information
 ================
 

Added: trunk/Graph/docs/tutorial_example_30.php
===================================================================
--- trunk/Graph/docs/tutorial_example_30.php    2007-01-04 11:02:35 UTC (rev 
4464)
+++ trunk/Graph/docs/tutorial_example_30.php    2007-01-04 11:08:14 UTC (rev 
4465)
@@ -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 );
+
+?>


Property changes on: trunk/Graph/docs/tutorial_example_30.php
___________________________________________________________________
Name: svn:eol-style
   + native

-- 
svn-components mailing list
svn-components@lists.ez.no
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to