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