Tuesday 23 October 2007

Gruff Graph Customisation



I've just managed to get my graph customisation up and running. You can now graph three different types of graph: pie, stackedbar and sidestackedbar.



The variables that you can customise are the width of the image in pixels, (automatically sets it to 4:3 ratio), graphing by project or job, data breakdown and specified flow.



Not all of these customisations are available to all graphs but the javascript control handles what the user can select. Different graphs work differently.

The way a pie graph handles data is by accepting a number, attached with the data identifier.


# Example of adding data to a pie graph.
g.data("Data Identifier", 50)


The way a sidestackedbar/stackedbar graph handles data is by accepting an array of values, attached with the data identifier.


# Example of adding data to a sidestackedbar/stackedbar graph.
g.data("Data Identifier", [1, 2, 5])




Of course there are so many other customisations that can be implemented but I don't think I have time to implement them. This will do for now.

For Gruff API reference, click here. Gruff samples can also be seen here.

No comments: