source: trunk/xgraph/jpgraph/Examples/example1.php

Last change on this file was 42, checked in by marrucho, 10 years ago
File size: 648 bytes
Line 
1<?php // content="text/plain; charset=utf-8"
2require_once ('jpgraph/jpgraph.php');
3require_once ('jpgraph/jpgraph_line.php');
4
5$ydata = array(11,3,8,12,5,1,9,13,5,7);
6
7// Create the graph. These two calls are always required
8$graph = new Graph(300,200);   
9$graph->SetScale("textlin");
10$graph->img->SetMargin(50,90,40,50);
11$graph->xaxis->SetFont(FF_FONT1,FS_BOLD);
12$graph->title->Set("Examples for graph");
13
14// Create the linear plot
15$lineplot=new LinePlot($ydata);
16$lineplot->SetLegend("Test 1");
17$lineplot->SetColor("blue");
18
19
20// Add the plot to the graph
21$graph->Add($lineplot);
22
23// Display the graph
24$graph->Stroke();
25?>
Note: See TracBrowser for help on using the repository browser.