Introduction | |
The GraphEngine is a generic chart rendering library. The primary use will be to generate charts for TikiSheet, but usage could be extended to other features in Tiki and other projects. The library should be working and integrated to TikiSheet by the 1.9 release. This page indicates the development status, decisions and various specification rules. It's written for those using the GraphEngine library (not the user interfaces that will use it) or extending it. Integration made in time for 1.9! Enable feature_charts.
|
GRenderer Specifications | |
|
Graphics | |
Feeding Data | |
Data is feed using series: single dimension arrays (keys will be ignored). Each graphic has to identify which series it uses. When called, setData() will verify if all required series are present and make sure they are valid. The series list is taken from getRequiredSeries(), which returns an associative array with the series name as the key and a boolean value to indicate if's mandatory. A non-mandatory series means the graphic will come up with replacement values. setData() recieves an associative array as the only parameter. The key is the name of the series and the value is an array containing the values. If the data is valid, _handleData() will be called so the graphic can handle the values and build proper internal structures. Some graphics might require unlimited amounts of series, such as a line graphic having n amount of lines. It's recommanded to create a single entry in getRequiredSeries() called 'y0'. setData() will make sure all the series listed are present, but will accept non-listed series as long as they are valid arrays. Examples of this will be created soon. |
Currently Available Graphics | |
|
Parameters | |
The output of graphics can be customized using parameters. All parameters have default values that can be overloaded. The setParam() method allows to do this operation. |
About Fake_GRenderer | |
The Fake_GRenderer class is a decorator class over any kind of renderer. It allows to create a renderer over a portion of the other renderer. The fake renderer is used internally to force methods to draw in specific portions of the graphic without sending 4 position parameters. For example, the _drawContent() abstract method recieves a renderer as the first argument. The draw() method initialize in Fake_GRenderer to the content area of the graphic after determining the size when title and legend have been positionned. This way, the child classes are totally independant and render their content in a 0 to 1 area, no matter what the real position is. The renderer could be used by clients to fit multiple different graphics in a same canevas without having to modify any of the graphics being rendered. The fake renderer forwards the method calls to the real renderer after scaling the positions and adding the offsets. All components are scaled down except the text. Since in all graphic libraries used the fonts have a static size, the size of the font cannot be scaled down. To keep consistency, opposite operations are applied in the calls to getTextWidth() and getTextHeight(). (You dont have to understand this, it magically works) |
Style List | |
TODO |
Layout Parameters | |
TODO |