Chart Elements - X Axis Menu - X Axis Labels 2
Documentation x_axis,
x_axis_labels,
x_axis_label.
All these settings can be overridden in the x_axis_label object.
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", "200", "9.0.0", "expressInstall.swf",
{"data-file":"gallery/x-axis-labels-2.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-labels-2.php
<?php
include '../php-ofc-library/open-flash-chart.php';
$title = new title( 'X Axis Labels Complex Example' );
$hol = new hollow_dot(); $hol->size(3)->halo_size(1)->tooltip('#x_label#<br>#val#');
$line = new line(); $line->set_default_dot_style($hol); $line->set_values( array(9,8,7,6,5,4,3,2,1) );
$chart = new open_flash_chart(); $chart->set_title( $title ); $chart->add_element( $line );
// // create an X Axis object // $x = new x_axis(); $x->set_colour( '#428C3E' ); $x->set_grid_colour( '#86BF83' );
// // Style the X Axis Labels: // $x_labels = new x_axis_labels();
// show every other label: $x_labels->set_steps( 2 );
// set them vertical $x_labels->set_vertical();
// make them red/pink-ish $x_labels->set_colour( '#CF4D5F' );
// nice big font $x_labels->set_size( 16 );
// set the label text $x_labels->set_labels( array( 'one','two','three','four','five','six','seven','eight','nine' ) );
// // Add the X Axis Labels to the X Axis // $x->set_labels( $x_labels );
// // Add the X Axis object to the chart: // $chart->set_x_axis( $x );
echo $chart->toPrettyString();
|
|