利用open flash chart生成图表 访问方式:
http://127.0.0.1/chart/chart.html?ofc=data.php
-
Hello World
- require_once('OFC/OFC_Chart.php');
- $title = new OFC_Elements_Title( '我的第一表:'.date("D M d Y") );
-
- $line_dot = new OFC_Charts_Line();
- $line_dot->set_values( array(6,2,7,8,10,12,7,6,5,12,10,9,11,4,3,2,1) );
- $line_dot->set_colour('#D7E4A3');
- $line_dot1 = new OFC_Charts_Line();
- $line_dot1->set_values( array(2,4,6,8,11,9,12,8,10,6,15,14,8,7,6,8,9,2,1) );
- $chart = new OFC_Chart();
- $chart->set_title( $title );
- $x=new OFC_Elements_Axis_X();
- $x->set_offset(false);
- $x->set_steps(1);
- $x->set_colour( '#A2ACBA');
- $x->set_range(0,20,1);
- $y=new OFC_Elements_Axis_Y();
- $y->set_range(0,16,1);
- $y->set_steps(1);
- $y->set_colour( '#A2ACBA');
- $chart->set_x_axis($x);
- $chart->set_y_axis($y);
- $chart->add_element( $line_dot );
- $chart->add_element( $line_dot1 );
- echo $chart->toPrettyString();
- ?>
|