source: code/Website/php5-ofc-library/examples/3d-bar-chart.php@ 7849

Last change on this file since 7849 was 7849, checked in by dennisw, 15 years ago
File size: 601 bytes
Line 
1<?php
2
3srand((double)microtime()*1000000);
4$data = array();
5
6// add random height bars:
7for( $i=0; $i<10; $i++ )
8 $data[] = rand(2,9);
9
10require_once('OFC/OFC_Chart.php');
11
12$title = new OFC_Elements_Title( date("D M d Y") );
13
14$bar = new OFC_Charts_Bar_3d();
15$bar->set_values( $data );
16$bar->colour = '#D54C78';
17
18$x_axis = new OFC_Elements_Axis_X();
19$x_axis->set_3d( 5 );
20$x_axis->colour = '#909090';
21$x_axis->set_labels( array(1,2,3,4,5,6,7,8,9,10) );
22
23$chart = new OFC_Chart();
24$chart->set_title( $title );
25$chart->add_element( $bar );
26$chart->set_x_axis( $x_axis );
27
28echo $chart->toPrettyString();
29
Note: See TracBrowser for help on using the repository browser.