diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2008-08-27 13:00:21 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2008-08-27 13:00:21 +0000 |
commit | 4a04cda9277e5cd089007ee3340d571e3217f20a (patch) | |
tree | 4d2db7d76ca0aa6eda2d4200383609cbddc2981f /src/interfaces | |
parent | cc24ba1a3e2bb75ce751a7ec72d140a6582ecf2c (diff) | |
download | zetacomponents-graph-4a04cda9277e5cd089007ee3340d571e3217f20a.zip zetacomponents-graph-4a04cda9277e5cd089007ee3340d571e3217f20a.tar.gz |
- Enhanced chart element documentation
Diffstat (limited to 'src/interfaces')
-rw-r--r-- | src/interfaces/axis_label_renderer.php | 3 | ||||
-rw-r--r-- | src/interfaces/dataset_property.php | 30 | ||||
-rw-r--r-- | src/interfaces/element.php | 64 |
3 files changed, 96 insertions, 1 deletions
diff --git a/src/interfaces/axis_label_renderer.php b/src/interfaces/axis_label_renderer.php index 4f925ee..9a5f064 100644 --- a/src/interfaces/axis_label_renderer.php +++ b/src/interfaces/axis_label_renderer.php @@ -11,6 +11,8 @@ * Abstract class to render labels and grids on axis. Will be extended to * make it possible using different algorithms for rendering axis labels. * + * Implements basic methods to render the grid and steps on a axis. + * * @property bool $majorStepCount * Count of major steps. * @property bool $minorStepCount @@ -435,4 +437,5 @@ abstract class ezcGraphAxisLabelRenderer extends ezcBaseOptions ezcGraphChartElementAxis $axis ); } + ?> diff --git a/src/interfaces/dataset_property.php b/src/interfaces/dataset_property.php index 3d427ff..ebc9a4c 100644 --- a/src/interfaces/dataset_property.php +++ b/src/interfaces/dataset_property.php @@ -10,6 +10,36 @@ /** * Abstract class for properties of datasets * + * This class is used to extends datasets with additional properties, and + * stores only non default values for each data point in a data set. + * + * The class is extended by property implementations including simple value + * validators, like: + * + * - ezcGraphDataSetAxisProperty + * - ezcGraphDataSetBooleanProperty + * - ezcGraphDataSetColorProperty + * - ezcGraphDataSetIntProperty + * - ezcGraphDataSetStringProperty + * + * The color property can for example be accessed in a chart like: + * + * <code> + * $graph = new ezcGraphLineChart(); + * $graph->data['example'] = new ezcGraphArrayDataSet( array( + * 'Foo' => 23, + * 'Bar' => 42, + * ) ); + * + * // Set color for all data points in this data set + * $graph->data['example']->color = '#a40000'; + * + * // Set different color for one special datapoint + * $graph->data['example']->color['Foo'] = '#2e3436'; + * + * $graph->render( 400, 200, 'test.svg' ); + * </code> + * * @version //autogentag// * @package Graph */ diff --git a/src/interfaces/element.php b/src/interfaces/element.php index 6c6c93e..21bc576 100644 --- a/src/interfaces/element.php +++ b/src/interfaces/element.php @@ -7,9 +7,71 @@ * @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved. * @license http://ez.no/licenses/new_bsd New BSD License */ + /** - * Class for basic chart elements + * Base class for chart elements + * + * The base class for chart elements. Chart elements can be understood as + * widgets or layout container inside the chart. The actual transformation to + * images happens inside the renderers. They represent all elements inside the + * chart and contain mostly general formatting options, while the renderer + * itself might define additional formatting options for some chart elments. + * + * Important chart elements for example are: + * + * - Chart title (ezcGraphChartElementText) + * - Chart legend (ezcGraphChartElementLegend) + * - The axis (ezcGraphChartElementNumericAxis, + * ezcGraphChartElementLogarithmicalAxis, ezcGraphChartElementLabeledAxis, + * ezcGraphChartElementDateAxis) + * - ... * + * The position of chart elements is defined in the $position property. The + * effect this has on the visual representation depends on the actual type of + * the chart element. + * + * Each chart element may be configured with options similar to CSS, used with + * HTML to define the general style of the repsective element: + * + * - $padding & $margin defne the distance of the border from inner elements / + * other chart elements. + * - $borderWidth & $border define the style of the border used around the + * chart element + * - $background defines the background color of the chart element. As always + * this may be a (semi-) transparent color. + * + * A typical example with some layout for the chart title element could look + * like: + * + * <code> + * $graph = new ezcGraphPieChart(); + * $graph->data['example'] = new ezcGraphArrayDataSet( array( + * 'Foo' => 23, + * 'Bar' => 42, + * ) ); + * + * // Set a title and format the title element + * $graph->title = 'Example formatted pie chart'; + * $graph->title->margin = 2; + * $graph->title->background = '#FFFFFF80'; + * $graph->title->border = '#FFFFFF'; + * $graph->title->borderWidth = 1; + * $graph->title->margin = 1; + * $graph->title->padding = 1; + * + * // Format the legend element + * $graph->legend->margin = 2; + * $graph->legend->background = '#FFFFFF80'; + * $graph->legend->border = '#FFFFFF'; + * $graph->legend->borderWidth = 1; + * $graph->legend->margin = 1; + * $graph->legend->padding = 1; + * + * $graph->background->background = '#888a85'; + * + * $graph->render( 400, 250, 'element.svg' ); + * </code> + * * @property string $title * Title of chart element. * @property ezcGraphColor $background |