diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2007-11-21 13:19:23 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2007-11-21 13:19:23 +0000 |
commit | 8babf06ba2eb872e81d74c31e90dcf02cb003ed3 (patch) | |
tree | fcfc8352d01a1c3fdb989f609ed86b506a5a23c8 /docs | |
parent | 8bcd92dae77bdb29379b2dd7fa5a28a3a7650d59 (diff) | |
download | zetacomponents-graph-8babf06ba2eb872e81d74c31e90dcf02cb003ed3.zip zetacomponents-graph-8babf06ba2eb872e81d74c31e90dcf02cb003ed3.tar.gz |
- Documented stacked bar charts in tutorial
Diffstat (limited to 'docs')
-rw-r--r-- | docs/img/tutorial_stacked_bar_chart.svg.png | bin | 0 -> 14957 bytes | |||
-rw-r--r-- | docs/tutorial.txt | 17 | ||||
-rw-r--r-- | docs/tutorial/tutorial_stacked_bar_chart.php | 22 |
3 files changed, 39 insertions, 0 deletions
diff --git a/docs/img/tutorial_stacked_bar_chart.svg.png b/docs/img/tutorial_stacked_bar_chart.svg.png Binary files differnew file mode 100644 index 0000000..56f99f4 --- /dev/null +++ b/docs/img/tutorial_stacked_bar_chart.svg.png diff --git a/docs/tutorial.txt b/docs/tutorial.txt index 2e25d15..5d33bb5 100644 --- a/docs/tutorial.txt +++ b/docs/tutorial.txt @@ -241,6 +241,23 @@ line and bar charts. .. image:: img/tutorial_bar_options.svg.png :alt: Configured highlight in combined line and bar chart +Stacked bar charts +~~~~~~~~~~~~~~~~~~ + +In stacked bar charts, the bars are not drawn next to each other, but +aggregated in one bar, and the overall bar consumes the space of the sum of all +single bars. + +.. include:: tutorial/tutorial_stacked_bar_chart.php + :literal: + +To use stacked bar charts, you only need to set the option $stackBars to true. +In the 3d renderer this will cause all bars to be renderer like with the symbol +ezcGraph::NO_SYMBOL. + +.. image:: img/tutorial_stacked_bar_chart.svg.png + :alt: Bar chart with stacked bars + Radar charts ------------ diff --git a/docs/tutorial/tutorial_stacked_bar_chart.php b/docs/tutorial/tutorial_stacked_bar_chart.php new file mode 100644 index 0000000..96f9c68 --- /dev/null +++ b/docs/tutorial/tutorial_stacked_bar_chart.php @@ -0,0 +1,22 @@ +<?php + +require_once 'tutorial_autoload.php'; +$wikidata = include 'tutorial_wikipedia_data.php'; + +$graph = new ezcGraphBarChart(); +$graph->title = 'Wikipedia articles'; + +// Stack bars +$graph->options->stackBars = true; + +// Add data +foreach ( $wikidata as $language => $data ) +{ + $graph->data[$language] = new ezcGraphArrayDataSet( $data ); +} + +$graph->yAxis->label = 'Thousand articles'; + +$graph->render( 400, 150, 'tutorial_stacked_bar_chart.svg' ); + +?> |