Open Flash Chart
Support This Project :: Home - Gallery - Y 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 - Y Axis - Legend

Thanks to 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
include_once 'ofc-library/open_flash_chart_object.php';
open_flash_chart_object550250'http://'$_SERVER['SERVER_NAME'] .'/open-flash-chart/gallery-data-6.php' );


// generate some random data

$max 180;
$tmp = array();
$x_labels = array();
$i=0$i<12$i++ )
$tmp[] = rand(0,$max);
$x_labels[] = $i;

'ofc-library/open-flash-chart.php' );
$g = new graph();
$g->set_data$tmp );
$g->line_hollow35'8B4B50''Sales'17 );
$g->set_x_labels$x_labels );
$g->set_y_max200 );
$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'''right''top' );
$g->x_axis_colour'#DAB7BB''#DAB7BB' );
$g->y_axis_colour'#DAB7BB''#DAB7BB' );
$g->set_x_label_style10'#8B4B50' );
$g->set_y_label_style10'#8B4B50' );

To see the data produced : gallery-data-6.php, then 'view source'.
Help support the project: Support This Project