[42] | 1 | <?php // content="text/plain; charset=utf-8"
|
---|
| 2 | require_once ('jpgraph/jpgraph.php');
|
---|
| 3 | require_once ('jpgraph/jpgraph_polar.php');
|
---|
| 4 |
|
---|
| 5 | //$data = array(22,12,27,40,80,48,120,40,142,27,170,12);
|
---|
| 6 |
|
---|
| 7 | $data = array(
|
---|
| 8 | 0,0,10,2,30,25,40,60,
|
---|
| 9 | 50,110,60,140,70,170,80,190,
|
---|
| 10 | 85,195,90,200,95,195,100,190,
|
---|
| 11 | 110,170,120,140,130,110,140,60,
|
---|
| 12 | 150,25,170,2,180,0);
|
---|
| 13 |
|
---|
| 14 | //$data2 = array(0,0,50,2,60,30,65,90,60,120,50,150,20,170,0,180);
|
---|
| 15 |
|
---|
| 16 | $data2 = array(0,0,34,56,90,90,170,65,220,90,270,120,300,60,355,10);
|
---|
| 17 |
|
---|
| 18 | $graph = new PolarGraph(350,350);
|
---|
| 19 | $graph->SetScale('lin',150);
|
---|
| 20 |
|
---|
| 21 | $graph->SetMarginColor('#FFE6C0');
|
---|
| 22 | $graph->SetType(POLAR_360);
|
---|
| 23 | $graph->SetMargin(40,40,50,40);
|
---|
| 24 | $graph->SetClockwise(true);
|
---|
| 25 |
|
---|
| 26 | //$graph->Set90AndMargin(60,50,70,120);
|
---|
| 27 |
|
---|
| 28 | $graph->SetBox(true);
|
---|
| 29 | $graph->SetFrame(false);
|
---|
| 30 | $graph->axis->ShowGrid(true,false,true);
|
---|
| 31 | $graph->axis->SetGridColor('gray','gray','gray');
|
---|
| 32 |
|
---|
| 33 | $graph->axis->SetFont(FF_ARIAL,FS_NORMAL,8);
|
---|
| 34 | $graph->axis->SetTitle('X-Axis','center');
|
---|
| 35 |
|
---|
| 36 | $graph->axis->SetColor('black','black','darkred');
|
---|
| 37 | $graph->axis->SetAngleFont(FF_ARIAL,FS_NORMAL,8);
|
---|
| 38 |
|
---|
| 39 | $graph->title->Set('Clockwise polar plot');
|
---|
| 40 | $graph->title->SetFont(FF_COMIC,FS_NORMAL,16);
|
---|
| 41 | $graph->title->SetColor('navy');
|
---|
| 42 |
|
---|
| 43 |
|
---|
| 44 |
|
---|
| 45 | $p = new PolarPlot($data);
|
---|
| 46 | $p->SetFillColor('lightblue@0.5');
|
---|
| 47 | $graph->Add($p);
|
---|
| 48 |
|
---|
| 49 | //$p2 = new PolarPlot($data2);
|
---|
| 50 | //$p2->SetFillColor('red@0.5');
|
---|
| 51 | //$graph->Add($p2);
|
---|
| 52 |
|
---|
| 53 | $graph->Stroke();
|
---|
| 54 |
|
---|
| 55 | ?>
|
---|