Warning this is an old version.

Take me to the latest version

Chart Elements - X Axis

Object: x_axis

Methods:

  • set_stroke( $stroke )
    Width of the X axis line and of the ticks
  • set_colour( $colour )
    Colour of the X axis line
  • set_tick_height( $height )
    Height of the ticks
  • set_grid_colour( $colour )
    Colour of the grid lines
  • set_offset( $o )
    If true, the X axis start half a step in
  • set_step( $step )
    Which ticks are visible.
  • set_3d( $val )
    Used in 3D charts
  • set_labels( $v )
    See X Axis Labels
  • set_labels_from_array( $a )
    See X Axis Labels

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';

$title = new titledate("D M d Y") );

$line_dot = new line_dot();
$line_dot->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_dot );

//
// create an X Axis object
//
$x = new x_axis();
$x->set_stroke10 );
$x->set_colour'#D7E4A3' );
$x->set_tick_height30 );
$x->set_grid_colour'#A2ACBA' );
$x->set_steps);
$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();
To see the data produced : gallery/x-axis.php, then 'view source'.
Support This Project
Adverts:


Open Flash Chart logo by numb.me.uk. | Syntax highlights are by GeSHi