summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2007-08-01 14:36:11 +0000
committerKore Nordmann <github@kore-nordmann.de>2007-08-01 14:36:11 +0000
commit26d70a2a24d560f24c75555c19527d63819c7150 (patch)
tree37b7e5630005fb596b396d2ef15ab9ee25a0aec0 /docs
parente04a4184c869d98aba9cd6af60472a62a27c235d (diff)
downloadzetacomponents-graph-26d70a2a24d560f24c75555c19527d63819c7150.zip
zetacomponents-graph-26d70a2a24d560f24c75555c19527d63819c7150.tar.gz
- Resolved #11141: Documented rotated labels on axis.
Diffstat (limited to 'docs')
-rw-r--r--docs/img/tutorial_rotated_labels.svg.pngbin0 -> 65439 bytes
-rw-r--r--docs/tutorial.txt26
-rw-r--r--docs/tutorial/tutorial_rotated_labels.php24
3 files changed, 50 insertions, 0 deletions
diff --git a/docs/img/tutorial_rotated_labels.svg.png b/docs/img/tutorial_rotated_labels.svg.png
new file mode 100644
index 0000000..53e6c19
--- /dev/null
+++ b/docs/img/tutorial_rotated_labels.svg.png
Binary files differ
diff --git a/docs/tutorial.txt b/docs/tutorial.txt
index 7234201..90de08d 100644
--- a/docs/tutorial.txt
+++ b/docs/tutorial.txt
@@ -580,6 +580,32 @@ for all available axis label renderers, but here is an overview:
between two labels. This helps to recognize which bars belong together.
Labels are rendered centered between two steps on the axis.
+Rotatad labels on axis
+~~~~~~~~~~~~~~~~~~~~~~
+
+There is one more new axis label renderer since version 1.1 of ezcGraph - the
+ezcGraphAxisRotatedLabelRenderer which enables you to render rotated labels on
+an axis.
+
+.. include:: tutorial/tutorial_rotated_labels.php
+ :literal:
+
+In line 9 a custom renderer is defined used for the labeled x axis. You can
+assign custom axis label renderers on the property $axisLabelRenderer for
+ezcGraphChartAxisElement objects.
+
+The renderer used in this example has custom properties like the rotation of
+the labels, which is set in degree, while the rotation direction depends on
+the direction of the axis.
+
+It makes sense to define more vertical space below the the axis for the
+rotated labels like done in line 11 of the above example.
+
+.. image:: img/tutorial_rotated_labels.svg.png
+ :alt: Date axis example
+
+The results conatins rotated labels, which enables you to pack a lot more
+labels on one axis.
Datasets
========
diff --git a/docs/tutorial/tutorial_rotated_labels.php b/docs/tutorial/tutorial_rotated_labels.php
new file mode 100644
index 0000000..98aba88
--- /dev/null
+++ b/docs/tutorial/tutorial_rotated_labels.php
@@ -0,0 +1,24 @@
+<?php
+
+require_once 'tutorial_autoload.php';
+$wikidata = include 'tutorial_wikipedia_data.php';
+
+$graph = new ezcGraphLineChart();
+$graph->title = 'Wikipedia articles';
+
+$graph->xAxis->axisLabelRenderer = new ezcGraphAxisRotatedLabelRenderer();
+$graph->xAxis->axisLabelRenderer->angle = 45;
+$graph->xAxis->axisSpace = .2;
+
+// Add data
+foreach ( $wikidata as $language => $data )
+{
+ $graph->data[$language] = new ezcGraphArrayDataSet( $data );
+}
+$graph->data['German']->displayType = ezcGraph::LINE;
+
+$graph->options->fillLines = 210;
+
+$graph->render( 400, 150, 'tutorial_rotated_labels.svg' );
+
+?>
OpenPOWER on IntegriCloud