Line | |
---|
1 | <?php // content="text/plain; charset=utf-8" |
---|
2 | |
---|
3 | require_once ('jpgraph/jpgraph.php'); |
---|
4 | require_once ('jpgraph/jpgraph_bar.php'); |
---|
5 | require_once ('jpgraph/jpgraph_line.php'); |
---|
6 | |
---|
7 | $datay=array(2,3,5,8.5,11.5,6,3); |
---|
8 | |
---|
9 | // Create the graph. |
---|
10 | $graph = new Graph(350,300); |
---|
11 | |
---|
12 | $graph->SetScale("textlin"); |
---|
13 | |
---|
14 | $graph->SetMarginColor('navy:1.9'); |
---|
15 | $graph->SetBox(); |
---|
16 | |
---|
17 | $graph->title->Set('Bar Pattern'); |
---|
18 | $graph->title->SetFont(FF_ARIAL,FS_BOLD,20); |
---|
19 | |
---|
20 | $graph->SetTitleBackground('lightblue:1.3',TITLEBKG_STYLE2,TITLEBKG_FRAME_BEVEL); |
---|
21 | $graph->SetTitleBackgroundFillStyle(TITLEBKG_FILLSTYLE_HSTRIPED,'lightblue','blue'); |
---|
22 | |
---|
23 | // Create a bar pot |
---|
24 | $bplot = new BarPlot($datay); |
---|
25 | $bplot->SetFillColor('darkorange'); |
---|
26 | $bplot->SetWidth(0.6); |
---|
27 | |
---|
28 | $bplot->SetPattern(PATTERN_CROSS1,'navy'); |
---|
29 | |
---|
30 | $graph->Add($bplot); |
---|
31 | |
---|
32 | $graph->Stroke(); |
---|
33 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.