]> git.sur5r.net Git - bacula/bacula/blob - gui/bacula-web/external_packages/phplot/examples/example8.php
Update
[bacula/bacula] / gui / bacula-web / external_packages / phplot / examples / example8.php
1 <?php
2 include("./data_date2.php");
3 include("../phplot.php");
4 $graph = new PHPlot(600,400);
5 $graph->SetPrintImage(0); //Don't draw the image yet
6
7 $graph->SetDataType("data-data-error");  //Must be called before SetDataValues
8
9 $graph->SetNewPlotAreaPixels(90,40,540,190);
10 $graph->SetDataValues($example_data);
11
12 $graph->SetXLabelType("time");
13 $graph->SetXLabelAngle(90);
14 $graph->SetXTitle("");
15 $graph->SetYTitle("Price");
16 $graph->SetYTickIncrement(20);
17 $graph->SetXTickIncrement(2679000);
18 $graph->SetXTimeFormat("%b %y");
19 $graph->SetPlotType("lines");
20 $graph->SetErrorBarShape("line");
21 $graph->SetPointShape("halfline");
22 $graph->SetYScaleType("log");
23 $graph->SetLineWidths(array(1));
24 $graph->SetPlotAreaWorld(883634400,1,915095000,140);
25 $graph->SetXDataLabelPos('none');
26 $graph->DrawGraph();
27
28 //Now do the second chart on the image
29
30 unset($example_data);
31
32 $graph->SetYScaleType("linear");
33 include("./data_date.php");
34
35 $graph->SetDataType("data-data");  //Must be called before SetDataValues
36
37 $graph->SetDataValues($example_data);
38 $graph->SetNewPlotAreaPixels(90,260,540,350);
39 $graph->SetDataValues($example_data);
40
41 $graph->SetXLabelType("time");
42 $graph->SetXLabelAngle(90);
43 $graph->SetXTitle("");
44 $graph->SetYTitle("Volume");
45 $graph->SetYTickIncrement(30);
46 $graph->SetPlotType("thinbarline");
47
48 //Set how to display the x-axis ticks
49 $graph->SetXTimeFormat("%b %y");
50 $graph->SetXTickIncrement(2679000);
51 $graph->SetXAxisPosition(0);  //Have to reset it after log plots
52
53 //Set Plot to go from x = Jan 1 1998, to x = Dec 31 1998
54 //      and from y = 0 to y = 90
55 $graph->SetPlotAreaWorld(883634400,0,915095000,90);
56
57 $graph->DrawGraph();
58
59 //Print the image
60 $graph->PrintImage();
61 ?>