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">

"open-flash-chart.swf", "my_chart",
"550", "400", "9.0.0", "expressInstall.swf",
{"data-file":"gallery/x-axis.php"} );

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]


include '../php-ofc-library/open-flash-chart.php';

$chart = new open_flash_chart();

$title = new titledate("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();

// Add the X Axis object to the chart:
$chart->set_x_axis$x );

To see the data produced : gallery/x-axis.php, then 'view source'.
Support This Project

Open Flash Chart logo by | Syntax highlights are by GeSHi