source: trunk/xgraph/jpgraph/Examples/radarlogex1.php @ 42

Last change on this file since 42 was 42, checked in by marrucho, 10 years ago
File size: 1.5 KB
Line 
1<?php // content="text/plain; charset=utf-8"
2require_once ('jpgraph/jpgraph.php');
3require_once ('jpgraph/jpgraph_log.php');
4require_once ('jpgraph/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,350);
12
13// Use logarithmic scale (If you don't use any SetScale()
14// the radar graph will default to linear scale
15$graph->SetScale('log');
16
17$graph->title->SetFont(FF_ARIAL,FS_BOLD,16);
18$graph->title->Set('Logarithmic scale');
19$graph->title->SetMargin(10);
20
21// Make the radar graph fill out it's bounding box
22$graph->SetPlotSize(0.8);
23$graph->SetCenter(0.5,0.55);
24
25// Uncomment the following line if you want to supress
26// minor tick marks
27//$graph->yscale->ticks->SupressMinorTickMarks();
28
29// We want the major tick marks to be black and minor
30// slightly less noticable
31$graph->yscale->ticks->SetMarkColor('black','darkgray');
32
33// Set the axis title font
34$graph->axis->title->SetFont(FF_ARIAL,FS_BOLD,14);
35$graph->axis->title->SetColor('darkred:0.8');
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$plot->SetFillColor('forestgreen@0.9');
44
45$plot2 = new RadarPlot($data2);
46$plot2->SetLineWeight(2);
47$plot2->SetColor('red');
48$plot2->SetFillColor('red@0.9');
49
50// Add the plot and display the graph
51$graph->Add($plot);
52$graph->Add($plot2);
53$graph->Stroke();
54?>
55
Note: See TracBrowser for help on using the repository browser.