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_object( 400, 250, '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( 3 ); $g->y_label_steps( 6 ); $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(); ?>
|
|