graphpite
[ class tree: graphpite ] [ index: graphpite ] [ all elements ]
Prev Next

Adding plots

The Image_Graph Tutorial

Adding plots

When the Image_Graph, Image_Graph_Plotarea and Image_Graph_Dataset is in place you can specify which plottype to use for displaying the data. There are a number of plottypes and they are all listed below.

The usage is however common for all of them so it's pretty straight forward to explain how to use them. The code example below demonstrates the usage:


1 ... // initially the Image_Graph, Image_Graph_Plotarea and Image_Graph_Dataset have been created
2 $Plot =& $Plotarea->addPlot(new Image_Graph_Plot_Line($DataSet));
3 ...

Plot types

There exist the following plottypes:

The following code example demonstrates how to create an Image_Graph_Plot_Smoothed_Area from scratch (this example will actually create a "real" graph):


1 $Graph =& new Image_Graph(800, 600); // create the graph
2 $Plotarea =& $Graph->add(new Image_Graph_Plotarea()); // create the plotarea
3 $Plot =& $Plotarea->addPlot(new Image_Graph_Plot_Smoothed_Area(
4 new Image_Graph_Dataset_Random(10, 20, 100)
5 );
6 // and a new Image_Graph_Plot_Smoothed_Area using a new Image_Graph_Dataset_Random
7 $Graph->Done();

Prev Up Next
Creating the dataset How to use Image_Graph Modifying appearance

Documentation generated on Wed, 15 Sep 2004 10:29:54 +0200 by phpDocumentor 1.2.3