Advanced Features - Background

Set the background colour of the chart.

Object: open_flash_chart()

Methods:

  • set_bg_colour( $colour )

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", "200", "9.0.0", "expressInstall.swf",
{"data-file":"gallery/background.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/background.php
<?php

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

$data = array();

$data[] = 3;
$data[] = 8;
$data[] = 2;
$data[] = null;
$data[] = 5;

$bar = new bar();
$bar->set_values$data );

$chart = new open_flash_chart();
$chart->set_title( new titledate("D M d Y") ) );
$chart->add_element$bar );
$chart->set_bg_colour'#FFFFFF' );

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

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