diff options
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' ); + +?> |