Gallery - Title
Change the title text and style.
Method: title()
title( string $title[, string $style] )
$title is the string to display.
$style (optional parameter) the CSS style string.
The styles that the title recognises are:
font-size, color, background-color, text-align, margin, margin-left,
margin-right, margin-top, margin-bottom, padding, padding-left,
padding-right, padding-top, padding-bottom
To turn the title off, see the remove the Y Axis example page.
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-3.php' ); ?>
Title size is in pixels, the colour is a HTML HEX colour string, e.g. '#FF0000' for red.
gallery-data-3.php
<?php
// generate some random data srand((double)microtime()*1000000);
$max = 20; $tmp = array(); for( $i=0; $i<9; $i++ ) { $tmp[] = rand(0,$max); }
include_once( 'ofc-library/open-flash-chart.php' ); $g = new graph(); $g->set_data( $tmp ); $g->set_x_labels( $tmp ); $g->title( 'Enter Shikari', '{font-size: 35px; color: #800000}' ); echo $g->render(); ?>
Make the title 10px, dark blue. When the title size is changed, the other
elements of the graph resize themselves automatically.
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-4.php' ); ?>
gallery-data-4.php
<?php
// generate some random data srand((double)microtime()*1000000);
$max = 20; $tmp = array(); for( $i=0; $i<9; $i++ ) { $tmp[] = rand(0,$max); }
include_once( 'ofc-library/open-flash-chart.php' ); $g = new graph(); $g->set_data( $tmp ); $g->set_x_labels( $tmp ); $g->title( 'Enter Shikari', '{font-size: 10px; color: #000080}' ); echo $g->render(); ?>
|