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

Using Radar/Spider Charts

The Image_Graph Tutorial

Using Radar/Spider Charts

The usage of Radar/Spider charts (called radar charts only in the following) are a bit different from the "normal" chart types such as Image_Graph_Plot_Line, Image_Graph_Plot_Bar, Image_Graph_Plot_Area, etc. The reason for this is that a radar chart (like a pie chart) does not show normal axis (X, Y). This means that you add a Image_Graph_Plot_Radar to a special kind of Image_Graph_Plotarea: the Image_Graph_Plotarea_Radar which contains a special axis (Image_Graph_Axis_Radar) for displaying on of the data dimensions as a wrapped circular axis (similar to the way a polar coordination system could work (i.e. (x,y) is replaced by (v, r) where v is an angle and r is a radius, but in the case of radarcharts v is calculated from the number of datapoints in the x dataset).

To create the radar plot area, simply replace the:


1 $Plotarea =& $Graph->add(new Image_Graph_Plotarea());

With a Image_Graph_Plotarea_Radar instead:


1 $Plotarea =& $Graph->add(new Image_Graph_Plotarea_Radar());

Then add the Image_Graph_Plot_Radar to the newly created plotarea, in the same "old" way:


1 $Plotarea->addPlot(
2 new Image_Graph_Plot_Radar(
3 new Image_Graph_Dataset_Random(8, 1, 5)
4 )
5 );

If you need to display more than one radar-chart in the same plotarea, it too is the same "old" way:


1 $RadarChart1 =& $Plotarea->addPlot(new Image_Graph_Plot_Radar($Dataset1));
2 $RadarChart2 =& $Plotarea->addPlot(new Image_Graph_Plot_Radar($Dataset2));
Prev Up Next
Image_Graph - PlotType Image_Graph - PlotType

Documentation generated on Wed, 15 Sep 2004 10:30:09 +0200 by phpDocumentor 1.2.3