Chart Elements - Title

Documentation: title. See the example code below for a better idea of how this works.

This goes into the <head> of the page:

<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">

swfobject.embedSWF(
"open-flash-chart.swf", "my_chart",
"550", "400", "9.0.0", "expressInstall.swf",
{"data-file":"gallery/title.php"} );

</script>
This writes the chart into a div with id="my_chart", right click and view source to see it in action, [the tutorials have more details]

gallery/title.php
<?php

include '../php-ofc-library/open-flash-chart.php';

// Make the chart
$chart = new open_flash_chart();

//
// Create a title object and set the text to todays date
//
$title = new titledate("D M d Y") );
$title->set_style"{font-size: 20px; font-family: Times New Roman; font-weight: bold; color: #A2ACBA; text-align: center;}" );
// add the title to the chart:
$chart->set_title$title );

$line_dot = new line();
$line_dot->set_values( array(9,8,7,6,5,4,3,2,1) );
$chart->add_element$line_dot );

$x = new x_axis();
$x->set_colour'#D7E4A3' );
$x->set_grid_colour'#A2ACBA' );
$x->set_labels( array('a','b','c','d','e','f','g','h','i') );

$chart->set_x_axis$x );

echo 
$chart->toPrettyString();
To see the data produced : gallery/title.php, then 'view source'.
Support This Project
Adverts:


Open Flash Chart logo by numb.me.uk. | Syntax highlights are by GeSHi