File: spiderlogex2.php

package info (click to toggle)
libphp-jpgraph 1.5.2-11%2Bu1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 888 kB
  • ctags: 2,689
  • sloc: php: 8,992; makefile: 24
file content (47 lines) | stat: -rw-r--r-- 1,279 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
include ("/usr/share/jpgraph/jpgraph.php");
include ("/usr/share/jpgraph/jpgraph_log.php");
include ("/usr/share/jpgraph/jpgraph_spider.php");

// Some data to plot
$data = array(242,58,500,12,397,810,373);

// Create the graph
$graph = new SpiderGraph(200,200,"auto");

// Uncomment the following line to use anti-aliasing 
// Note: Enabling this results in a very noticable slow
// down of the image generation! And more load on your
// server. Use it wisly!!
$graph->img->SetAntiAliasing();

// Make the spider graph fill out it's bounding box
$graph->SetPlotSize(0.85);

// Use logarithmic scale (If you don't use any SetScale()
// the spider graph will default to linear scale
$graph->SetScale("log");

// Uncomment the following line if you want to supress
// minor tick marks
// $graph->yscale->ticks->SupressMinorTickMarks();

// We want the major tick marks to be black and minor
// slightly less noticable
$graph->yscale->ticks->SetMarkColor("black","darkgray");

// Set the axis title font 
$graph->axis->title->SetFont(FF_ARIAL,FS_BOLD,12);

// Use blue axis
$graph->axis->SetColor("blue");

$plot = new SpiderPlot($data);
$plot->SetLineWeight(2);
$plot->SetColor('forestgreen');

// Add the plot and display the graph
$graph->Add($plot);
$graph->Stroke();
?>