Open Flash Chart
Support This Project :: Home - Gallery - Title
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 - 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_object400250'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();
?>
To see the data produced : gallery-data-3.php, then 'view source'.

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_object400250'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();
?>
To see the data produced : gallery-data-4.php, then 'view source'.
Help support the project: Support This Project

Adverts: