diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2008-08-20 11:10:02 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2008-08-20 11:10:02 +0000 |
commit | cc24ba1a3e2bb75ce751a7ec72d140a6582ecf2c (patch) | |
tree | 7eae31b768d5ec8c6f90c7fe76ba02a1155d3729 /docs | |
parent | 59e15d56899406f7cff4fd3eae3a370410e0c898 (diff) | |
download | zetacomponents-graph-cc24ba1a3e2bb75ce751a7ec72d140a6582ecf2c.zip zetacomponents-graph-cc24ba1a3e2bb75ce751a7ec72d140a6582ecf2c.tar.gz |
- More documentation improvements
# There is still some way to go...
Diffstat (limited to 'docs')
-rw-r--r-- | docs/img/tutorial_chart_font_configuration.svg.png | bin | 0 -> 22368 bytes | |||
-rw-r--r-- | docs/tutorial.txt | 14 | ||||
-rw-r--r-- | docs/tutorial/tutorial_chart_font_configuration.php | 29 |
3 files changed, 40 insertions, 3 deletions
diff --git a/docs/img/tutorial_chart_font_configuration.svg.png b/docs/img/tutorial_chart_font_configuration.svg.png Binary files differnew file mode 100644 index 0000000..704557d --- /dev/null +++ b/docs/img/tutorial_chart_font_configuration.svg.png diff --git a/docs/tutorial.txt b/docs/tutorial.txt index fc862f1..e6d5126 100644 --- a/docs/tutorial.txt +++ b/docs/tutorial.txt @@ -449,8 +449,7 @@ Chart elements ============== The chart elements all extend ezcGraphChartElement. Each of the elements can be -configured independently. A default chart consists of -the following elements: +configured independently. A default chart consists of the following elements: - title - background @@ -474,7 +473,16 @@ for each chart element. The solution is that you can modify the global font configuration by accessing $graph->options->font. This takes effect on all chart elements unless you intentionally access the font configuration of an individual chart -element. The following section shows an example of this. +element. The following example shows how this works. + +.. include:: tutorial/tutorial_chart_font_configuration.php + :literal: + +The output of the example shows, that all texts are using a serif font, while +the title still stays with the default sans-serif font. + +.. image:: img/tutorial_chart_font_configuration.svg.png + :alt: Font configuration in pie chart The chart title --------------- diff --git a/docs/tutorial/tutorial_chart_font_configuration.php b/docs/tutorial/tutorial_chart_font_configuration.php new file mode 100644 index 0000000..a564f62 --- /dev/null +++ b/docs/tutorial/tutorial_chart_font_configuration.php @@ -0,0 +1,29 @@ +<?php + +require_once 'tutorial_autoload.php'; + +$graph = new ezcGraphPieChart(); +$graph->palette = new ezcGraphPaletteEzBlue(); +$graph->title = 'Access statistics'; + +// Set the maximum font size to 8 for all chart elements +$graph->options->font->maxFontSize = 8; + +// Set the font size for the title independently to 14 +$graph->title->font->maxFontSize = 14; + +// The following only affects all elements except the // title element, +// which now has its own font configuration. +$graph->options->font->name = 'serif'; + +$graph->data['Access statistics'] = new ezcGraphArrayDataSet( array( + 'Mozilla' => 19113, + 'Explorer' => 10917, + 'Opera' => 1464, + 'Safari' => 652, + 'Konqueror' => 474, +) ); + +$graph->render( 400, 150, 'tutorial_chart_font_configuration.svg' ); + +?> |