Chart Elements - X Axis Menu - X Axis
The simplest X axis allows the chart to choose values for you. Here we simply
colour the lines and tell it to label every other point.
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_steps( 2 );
// // Add the X Axis object to the chart: // $chart->set_x_axis( $x );
echo $chart->toPrettyString();
|
|