From 6dcb98c4e47b4f8ef728441521882fd08505367b Mon Sep 17 00:00:00 2001 From: Kore Nordmann Date: Thu, 4 Jan 2007 11:08:14 +0000 Subject: - Resolved task #9910: Add "renderToOutput" example to Graph tutorial. --- docs/tutorial.txt | 16 ++++++++++++++++ docs/tutorial_example_30.php | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 docs/tutorial_example_30.php diff --git a/docs/tutorial.txt b/docs/tutorial.txt index 9ca127d..edb4c78 100644 --- a/docs/tutorial.txt +++ b/docs/tutorial.txt @@ -895,6 +895,22 @@ generated bitmap`__. __ 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 ================ diff --git a/docs/tutorial_example_30.php b/docs/tutorial_example_30.php new file mode 100644 index 0000000..738c0e4 --- /dev/null +++ b/docs/tutorial_example_30.php @@ -0,0 +1,19 @@ +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 ); + +?> -- cgit v1.1