1 | <?php // content="text/plain; charset=utf-8"
|
---|
2 |
|
---|
3 | require_once ('jpgraph/jpgraph.php');
|
---|
4 | require_once ('jpgraph/jpgraph_polar.php');
|
---|
5 |
|
---|
6 | $data = array(0,1,10,2,30,25,40,60,
|
---|
7 | 50,110,60,160,70,210,75,230,80,260,85,370,
|
---|
8 | 90,480,
|
---|
9 | 95,370,100,260,105,230,
|
---|
10 | 110,210,120,160,130,110,140,60,
|
---|
11 | 150,25,170,2,180,1);
|
---|
12 |
|
---|
13 | $n = count($data);
|
---|
14 | for( $i=0; $i < $n; ++$i ) {
|
---|
15 | $targets[$i] = "#$i";
|
---|
16 | }
|
---|
17 |
|
---|
18 | $graph = new PolarGraph(350,320);
|
---|
19 | $graph->SetScale('log',100);
|
---|
20 | $graph->SetType(POLAR_180);
|
---|
21 |
|
---|
22 | // Hide frame around graph (by setting width=0)
|
---|
23 | $graph->SetFrame(true,'white',1);
|
---|
24 |
|
---|
25 | // Show both major and minor grid lines
|
---|
26 | $graph->axis->ShowGrid(true,true);
|
---|
27 |
|
---|
28 | // Set color for gradient lines
|
---|
29 | $graph->axis->SetGridColor('lightblue:0.9','lightblue:0.9','lightblue:0.9');
|
---|
30 |
|
---|
31 | // Set label and axis colors
|
---|
32 | $graph->axis->SetColor('black','navy','darkred');
|
---|
33 |
|
---|
34 | // Draw the ticks on the bottom side of the radius axis
|
---|
35 | $graph->axis->SetTickSide(SIDE_DOWN);
|
---|
36 |
|
---|
37 | // Increase the margin for the labels since we changed the
|
---|
38 | // side of the ticks.
|
---|
39 | $graph->axis->SetLabelMargin(6);
|
---|
40 |
|
---|
41 | // Change fonts
|
---|
42 | $graph->axis->SetFont(FF_ARIAL,FS_NORMAL,8);
|
---|
43 | $graph->axis->SetAngleFont(FF_ARIAL,FS_NORMAL,8);
|
---|
44 |
|
---|
45 | // Setup axis title
|
---|
46 | $graph->axis->SetTitle('Coverage (in meter)','middle');
|
---|
47 | $graph->axis->title->SetFont(FF_FONT1,FS_BOLD);
|
---|
48 |
|
---|
49 | // Setup graph title
|
---|
50 | $graph->title->Set('Polar plot #9');
|
---|
51 | $graph->title->SetFont(FF_ARIAL,FS_BOLD,16);
|
---|
52 | $graph->title->SetColor('navy');
|
---|
53 |
|
---|
54 | // Setup tab title
|
---|
55 | $graph->tabtitle->Set('Microphone #1');
|
---|
56 | $graph->tabtitle->SetColor('brown:0.5','lightyellow');
|
---|
57 |
|
---|
58 | // Setup the polar plot with CSIM targets for the marks
|
---|
59 | $p = new PolarPlot($data);
|
---|
60 | $p->SetFillColor('lightblue@0.5');
|
---|
61 | $p->mark->SetType(MARK_SQUARE);
|
---|
62 | $p->mark->SetWidth(10);
|
---|
63 | $p->SetCSIMTargets( $targets );
|
---|
64 |
|
---|
65 | $graph->Add($p);
|
---|
66 |
|
---|
67 | $graph->StrokeCSIM();
|
---|
68 |
|
---|
69 | ?>
|
---|