Open Flash Chart
Support This Project :: Home - Gallery - X Axis - Legend
Info: Open Flash Chart 2 is out. Version 1.x and these pages will never disappear and the charts will continue working forever, but further development on 1.x has stopped. Take a look at version 2 here Open Flash Chart 2.

Gallery - X Axis - Legend

set_x_legend( $text, $size=-1, $colour='' )
$text is the string to display.
$size (optional parameter) in pixels.
$colour (optional parameter) HEX colour string.

Create the flash object
<?php
include_once 'ofc-library/open_flash_chart_object.php';
open_flash_chart_object400250'http://'$_SERVER['SERVER_NAME'] .'/open-flash-chart/gallery-data-10.php' );
?>

A simple sin() wave is shown, the X axis labels are removed, and the X legend is made 20 pixels high.

gallery-data-10.php
<?php

// generate some random data
srand((double)microtime()*1000000);

$tmp = array();
for( 
$i=0$i<8$i+=0.2 )
{
  
$tmp[] = sin($i) + 1.5;
}

include_once( 
'ofc-library/open-flash-chart.php' );
$g = new graph();
$g->set_data$tmp );
$g->set_x_labels$x_labels );
$g->set_y_max);
$g->y_label_steps);
$g->set_y_legend'Wave height (cm)'15'#736AFF' );
$g->set_x_legend'Waves in Feburary'20'#736AFF' );
$g->title'Portreath beach''{font-size: 25px; color: #736AFF}' );
echo 
$g->render();
?>
To see the data produced : gallery-data-10.php, then 'view source'.
Help support the project: Support This Project

Adverts: