diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-04-25 09:04:21 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-04-25 09:04:21 +0000 |
commit | 6207fc1ece307264f8e9e877edfade373f6da1f3 (patch) | |
tree | 313452f49643b95a4461c2a1d3ea3f9ab296aa26 /design/design.txt | |
parent | d723a55abc474d0f4849381834a201b4dd2ac4c4 (diff) | |
download | zetacomponents-graph-6207fc1ece307264f8e9e877edfade373f6da1f3.zip zetacomponents-graph-6207fc1ece307264f8e9e877edfade373f6da1f3.tar.gz |
- Added code example to show the API
- Modified the definition of DataSets
Diffstat (limited to 'design/design.txt')
-rw-r--r-- | design/design.txt | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/design/design.txt b/design/design.txt index ab26a15..c41e758 100644 --- a/design/design.txt +++ b/design/design.txt @@ -24,9 +24,9 @@ ezcGraphManager ezcGraphDataset Receives the user data, and stores the configuration for the dataset, like - color, label, etc. Contains a finite count of ezcGraphDatasetData objects. - Can be extended to perform algorithms like polynomial interpolation, - averaging and bezier interpolation on the data. + color, label, etc. How the data is stored depends on the kind of the + dataset. The dataset will be extended for algorithms like averaging and + polynomial interpolation in the dataset. ezcGraphChart Abstract class, which handles the global charts options like background @@ -89,13 +89,38 @@ primitives accoringly to the selected renderer. The datasets can be configured individually by the user of the package. -Data Structures -=============== +API example +----------- -ezcGraphDatasetData - Stores the data and offers options to set color and label for single - potions of data. Data can be highlighted, the presentation depends on the - charttype (Label value in line charts, move pie outwards in pie charts). +The following example shows how to use the class: :: + + <?php + + $pie = ezcGraph::create( 'Pie' ); + $pie->options->backgroundImage = 'background.png'; + $pie->options->border->color = '#ff0000'; + $pie->title = 'Apple Pie'; + + $pie->humanoids = array( 'monkey' => 54, 'ape' => 37, 'human' => 9 ); // adds a new data set + $pie->humanoids->color['monkey'] = 'blueish'; // setting datapoint color + $pie->humanoids->highlight( 'monkey' ); // chart type dependent + + + $line = ezcGraph::create( 'Line' ); + $line->options->backgroundColor = 'pink'; + + $line->income = array( 1990 => 5, 5.1, 5.4, 5.3, 6.9 ); + $line->income->color = 'blue'; + $line->income->symbol = ezcGraph::diamond; + + $line->incomeWithTax = array( 1990 => 4.9, 5.0, 5.2, 5.1, 6.4 ); + $line->incomeWithTax->color = 'red'; + $line->incomeWithTax->symbol = ezcGraph::squareWithChupi; + + // Create a new averaging line + $line->averageIncome = ezcDataSetAverage::createFrom($line->income[, options]); + + ?> |