plottype
[ class tree: plottype ] [ index: plottype ] [ all elements ]
Prev Next
Using Radar/Spider Charts

Using Radar/Spider Charts

The GraPHPite 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 LineChart, BarChart, AreaChart, 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 RadarChart to a special kind of PlotArea: the PlotAreaRadar which contains a special axis (AxisRadar) 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. $GraPHP->add(new PlotArea(), "PlotArea");

With a PlotAreaRadar instead:

  1. $GraPHP->add(new PlotAreaRadar(), "PlotArea");

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

  1. $PlotArea->addPlot(new RadarChart(new RandomDataSet(8, 1, 5)), "RadarChart");

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

  1. $PlotArea->addPlot(new RadarChart(new RandomDataSet(8, 1, 5)), "RadarChart1");
  2. $PlotArea->addPlot(new RadarChart(new RandomDataSet(8, 1, 5)), "RadarChart2");
Prev Up Next
GraPHPite - PlotType GraPHPite - PlotType

Documentation generated on Fri, 12 Nov 2004 08:24:52 +0100 by phpDocumentor 1.3.0RC3