1 | <?php // content="text/plain; charset=utf-8" |
---|
2 | // A simple Polar graph, |
---|
3 | |
---|
4 | require_once ('jpgraph/jpgraph.php'); |
---|
5 | require_once ('jpgraph/jpgraph_polar.php'); |
---|
6 | |
---|
7 | |
---|
8 | $data = array(0,1,10,2,30,25,40,60, |
---|
9 | 50,110,60,160,70,210,75,230,80,260,85,370, |
---|
10 | 90,480, |
---|
11 | 95,370,100,260,105,230, |
---|
12 | 110,210,120,160,130,110,140,60, |
---|
13 | 150,25,170,2,180,1); |
---|
14 | |
---|
15 | $graph = new PolarGraph(350,400); |
---|
16 | $graph->SetScale('log',100); |
---|
17 | $graph->SetType(POLAR_180); |
---|
18 | //$graph->SetPlotSize(250,250); |
---|
19 | |
---|
20 | // Hide frame around graph (by setting width=0) |
---|
21 | $graph->SetFrame(true,'white',1); |
---|
22 | |
---|
23 | // Set plotarea color |
---|
24 | $graph->SetColor('lightblue'); |
---|
25 | |
---|
26 | // Show both major and minor grid lines |
---|
27 | $graph->axis->ShowGrid(true,true); |
---|
28 | |
---|
29 | // Set color for gradient lines |
---|
30 | $graph->axis->SetGridColor('lightblue:0.8','lightblue:0.8','lightblue:0.8'); |
---|
31 | |
---|
32 | // Setup axis title |
---|
33 | $graph->axis->SetTitle('Coverage (in meter)','middle'); |
---|
34 | $graph->axis->title->SetFont(FF_FONT1,FS_BOLD); |
---|
35 | |
---|
36 | $graph->title->Set('Polar plot #8'); |
---|
37 | $graph->title->SetFont(FF_ARIAL,FS_BOLD,16); |
---|
38 | $graph->title->SetColor('navy'); |
---|
39 | |
---|
40 | // Adjust legen box position and color |
---|
41 | $graph->legend->SetColor('navy','darkgray'); |
---|
42 | $graph->legend->SetFillColor('white'); |
---|
43 | $graph->legend->SetShadow('darkgray@0.5',5); |
---|
44 | |
---|
45 | $p = new PolarPlot($data); |
---|
46 | $p->SetFillColor('white@0.5'); |
---|
47 | $p->mark->SetType(MARK_SQUARE); |
---|
48 | $p->SetLegend("Mirophone #1\n(No amps)"); |
---|
49 | |
---|
50 | $graph->Add($p); |
---|
51 | |
---|
52 | $graph->Stroke(); |
---|
53 | |
---|
54 | ?> |
---|