source: trunk/xgraph/jpgraph/Examples/theme_example.php @ 42

Last change on this file since 42 was 42, checked in by marrucho, 10 years ago
File size: 805 bytes
Line 
1<?php
2require_once ('jpgraph/jpgraph.php');
3require_once ('jpgraph/jpgraph_bar.php');
4
5$data1y=array(47,80,40,116);
6$graph = new Graph(400, 300, 'auto');
7$graph->SetScale('textlin');
8
9$theme_class = new AquaTheme;
10$graph->SetTheme($theme_class);
11
12// after setting theme, you can change details as you want
13$graph->SetFrame(true, 'lightgray');                        // set frame visible
14
15$graph->xaxis->SetTickLabels(array('A','B','C','D')); // change xaxis lagels
16$graph->title->Set("Theme Example");                    // add title
17
18// add barplot
19$bplot = new BarPlot($data1y);
20$graph->Add($bplot);
21
22// you can change properties of the plot only after calling Add()
23$bplot->SetWeight(0);
24$bplot->SetFillGradient('#FFAAAA:0.7', '#FFAAAA:1.2', GRAD_VER);   
25
26$graph->Stroke();
Note: See TracBrowser for help on using the repository browser.