1 | <?php // content="text/plain; charset=utf-8" |
---|
2 | require_once ('jpgraph/jpgraph.php'); |
---|
3 | require_once ('jpgraph/jpgraph_log.php'); |
---|
4 | require_once ('jpgraph/jpgraph_radar.php'); |
---|
5 | |
---|
6 | // Some data to plot |
---|
7 | $data = array(242,58,500,12,397,810,373); |
---|
8 | |
---|
9 | // Create the graph |
---|
10 | $graph = new RadarGraph(200,200); |
---|
11 | |
---|
12 | // Uncomment the following line to use anti-aliasing |
---|
13 | // Note: Enabling this results in a very noticable slow |
---|
14 | // down of the image generation! And more load on your |
---|
15 | // server. Use it wisly!! |
---|
16 | $graph->img->SetAntiAliasing(); |
---|
17 | |
---|
18 | // Make the spider graph fill out it's bounding box |
---|
19 | $graph->SetPlotSize(0.85); |
---|
20 | |
---|
21 | // Use logarithmic scale (If you don't use any SetScale() |
---|
22 | // the spider graph will default to linear scale |
---|
23 | $graph->SetScale("log"); |
---|
24 | |
---|
25 | // Uncomment the following line if you want to supress |
---|
26 | // minor tick marks |
---|
27 | // $graph->yscale->ticks->SupressMinorTickMarks(); |
---|
28 | |
---|
29 | // We want the major tick marks to be black and minor |
---|
30 | // slightly less noticable |
---|
31 | $graph->yscale->ticks->SetMarkColor("black","darkgray"); |
---|
32 | |
---|
33 | // Set the axis title font |
---|
34 | $graph->axis->title->SetFont(FF_ARIAL,FS_BOLD,12); |
---|
35 | |
---|
36 | // Use blue axis |
---|
37 | $graph->axis->SetColor("blue"); |
---|
38 | |
---|
39 | $plot = new RadarPlot($data); |
---|
40 | $plot->SetLineWeight(2); |
---|
41 | $plot->SetColor('forestgreen'); |
---|
42 | |
---|
43 | // Add the plot and display the graph |
---|
44 | $graph->Add($plot); |
---|
45 | $graph->Stroke(); |
---|
46 | ?> |
---|
47 | |
---|