Gallery - Y Axis - Legend
Thanks to http://webbie.suppi.net/ressources.php?backgrounds for the art.
Method: set_y_legend()
set_y_legend( string $text[, int $size=-1][, string $colour=''] )
$text is the string to display.
$size (optional parameter) in pixels.
$colour (optional parameter) HEX colour string.
If you change the font size, the chart resizes to accommodate it. To remove the Y legend, don't call the set_y_legend() method.
Note Open Flash Chart has a known bug. The Y axis legend will not show unicode characters correctly. This seems
to be a bug in flash its self.
Create the flash object
<?php include_once 'ofc-library/open_flash_chart_object.php'; open_flash_chart_object( 550, 250, 'http://'. $_SERVER['SERVER_NAME'] .'/open-flash-chart/gallery-data-6.php' ); ?>
gallery-data-6.php
<?php
// generate some random data srand((double)microtime()*1000000);
$max = 180; $tmp = array(); $x_labels = array(); for( $i=0; $i<12; $i++ ) { $tmp[] = rand(0,$max); $x_labels[] = $i; }
include_once( 'ofc-library/open-flash-chart.php' ); $g = new graph(); $g->set_data( $tmp ); $g->line_hollow( 3, 5, '8B4B50', 'Sales', 17 ); $g->set_x_labels( $x_labels ); $g->set_y_max( 200 ); $g->y_label_steps( 4 ); $g->set_y_legend( 'Flower sales (x 1000)', 15, '#8B4B50' ); $g->title( 'My Flower Shop', '{font-size: 25px; color: #8B4B50; margin: 15px 0 15px 0; background-color: #E7D1D3}' );
$g->bg_colour = '#E7D1D3'; $g->set_bg_image( 'http://teethgrinder.co.uk/open-flash-chart/images/flowers.png', 'right', 'top' ); $g->x_axis_colour( '#DAB7BB', '#DAB7BB' ); $g->y_axis_colour( '#DAB7BB', '#DAB7BB' ); $g->set_x_label_style( 10, '#8B4B50' ); $g->set_y_label_style( 10, '#8B4B50' );
echo $g->render(); ?>
|
|