Chart Elements - X Axis
Documentation: x_axis
This goes into the <head> of the page:
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF(
"open-flash-chart.swf", "my_chart",
"550", "400", "9.0.0", "expressInstall.swf",
{"data-file":"gallery/x-axis.php"} );
</script>
This writes the chart into a div with id="my_chart",
right click and view source to see it in action,
[the tutorials have more details]
gallery/x-axis.php
<?php
include '../php-ofc-library/open-flash-chart.php';
$chart = new open_flash_chart();
$title = new title( date("D M d Y") );
$line_dot = new line(); $line_dot->set_values( array(9,8,7,6,5,4,3,2,1) );
$chart->set_title( $title ); $chart->add_element( $line_dot );
// // create an X Axis object // $x = new x_axis(); $x->set_stroke( 10 ); $x->set_colour( '#D7E4A3' ); $x->set_tick_height( 30 ); $x->set_grid_colour( '#A2ACBA' ); $x->set_steps( 2 ); $x->set_labels_from_array( array('a','b','c','d','e','f','g','h','i') );
// // Add the X Axis object to the chart: // $chart->set_x_axis( $x );
echo $chart->toPrettyString();
|
|