[42] | 1 | <?php // content="text/plain; charset=utf-8" |
---|
| 2 | require_once ('jpgraph/jpgraph.php'); |
---|
| 3 | require_once ('jpgraph/jpgraph_radar.php'); |
---|
| 4 | |
---|
| 5 | // Create the basic radar graph |
---|
| 6 | $graph = new RadarGraph(300,200); |
---|
| 7 | //$graph->img->SetAntiAliasing(); |
---|
| 8 | |
---|
| 9 | // Set background color and shadow |
---|
| 10 | $graph->SetColor("white"); |
---|
| 11 | $graph->SetShadow(); |
---|
| 12 | |
---|
| 13 | // Position the graph |
---|
| 14 | $graph->SetCenter(0.4,0.55); |
---|
| 15 | |
---|
| 16 | // Setup the axis formatting |
---|
| 17 | $graph->axis->SetFont(FF_FONT1,FS_BOLD); |
---|
| 18 | |
---|
| 19 | // Setup the grid lines |
---|
| 20 | $graph->grid->SetLineStyle("solid"); |
---|
| 21 | $graph->grid->SetColor("navy"); |
---|
| 22 | $graph->grid->Show(); |
---|
| 23 | $graph->HideTickMarks(); |
---|
| 24 | |
---|
| 25 | // Setup graph titles |
---|
| 26 | $graph->title->Set("Quality result"); |
---|
| 27 | $graph->title->SetFont(FF_FONT1,FS_BOLD); |
---|
| 28 | $graph->SetTitles($gDateLocale->GetShortMonth()); |
---|
| 29 | |
---|
| 30 | // Create the first radar plot |
---|
| 31 | $plot = new RadarPlot(array(70,80,60,90,71,81,47)); |
---|
| 32 | $plot->SetLegend("Goal"); |
---|
| 33 | $plot->SetColor("red","lightred"); |
---|
| 34 | $plot->SetFill(false); |
---|
| 35 | $plot->SetLineWeight(2); |
---|
| 36 | |
---|
| 37 | // Create the second radar plot |
---|
| 38 | $plot2 = new RadarPlot(array(70,40,30,80,31,51,14)); |
---|
| 39 | $plot2->SetLegend("Actual"); |
---|
| 40 | $plot2->SetLineWeight(2); |
---|
| 41 | $plot2->SetColor("blue"); |
---|
| 42 | $plot2->SetFill(false); |
---|
| 43 | |
---|
| 44 | // Add the plots to the graph |
---|
| 45 | $graph->Add($plot2); |
---|
| 46 | $graph->Add($plot); |
---|
| 47 | |
---|
| 48 | // And output the graph |
---|
| 49 | $graph->Stroke(); |
---|
| 50 | |
---|
| 51 | ?> |
---|