Chart Elements - Y Axis Menu - Y Axis
Documentation: y_axis,
y_axis_base
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/y-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/y-axis.php
<?php
include '../php-ofc-library/open-flash-chart.php';
$title = new title( date("D M d Y") );
$line_dot = new line(); $line_dot->set_values( array(4,5,6,7,6,5,4,3,2) );
$chart = new open_flash_chart(); $chart->set_title( $title ); $chart->add_element( $line_dot );
// // create a Y Axis object // $y = new y_axis(); $y->set_stroke(3); $y->set_colour( '#D7E4A3' ); $y->set_tick_length(7); $y->set_grid_colour( '#A2ACBA' ); // grid steps: $y->set_range( 0, 8, 2);
$y_labels = new y_axis_labels(); $y_labels->set_labels( array('Zero','One','Two','Three','Four','Five','Six','Seven','Eight') ); // visible labels steps: $y_labels->set_steps(4); $y->set_labels($y_labels);
// // Add the Y Axis object to the chart: // $chart->set_y_axis( $y );
echo $chart->toPrettyString();
|
Adverts:
|