source: trunk/xgraph/jpgraph/Examples/polarex7.php

Last change on this file was 42, checked in by marrucho, 10 years ago
File size: 1.4 KB
Line 
1<?php // content="text/plain; charset=utf-8"
2// A simple Polar graph,
3
4require_once ('jpgraph/jpgraph.php');
5require_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(300,350);
16$graph->SetScale('lin',300);
17$graph->SetType(POLAR_180);
18$graph->SetPlotSize(220,250);
19
20// Hide frame around graph (by setting width=0)
21$graph->SetFrame(true,'white',1);
22
23$graph->SetBackgroundGradient('blue:1.3','brown:1.4',GRAD_HOR,BGRAD_PLOT);
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('gray','gray','gray');
30
31// Setup axis title
32$graph->axis->SetTitle('Coverage (in meter)','middle');
33$graph->axis->title->SetFont(FF_FONT1,FS_BOLD);
34
35$graph->title->Set('Polar plot #7');
36$graph->title->SetFont(FF_ARIAL,FS_BOLD,16);
37$graph->title->SetColor('navy');
38
39// Adjust legen box position and color
40$graph->legend->SetColor('navy','darkgray');
41$graph->legend->SetFillColor('white');
42$graph->legend->SetShadow('darkgray@0.5',5);
43
44$p = new PolarPlot($data);
45$p->SetFillColor('lightblue@0.5');
46$p->mark->SetType(MARK_SQUARE);
47$p->SetLegend("Mirophone #1\n(No amps)");
48
49$graph->Add($p);
50
51$graph->Stroke();
52
53?>
Note: See TracBrowser for help on using the repository browser.