Tutorial Open Flash Chart Horizontal Chart Chart
Tutorial Open Flash Chart Horizontal Chart Chart
c. tooltip hover
data_ofc_horisontalbar_tooltip_hover.php
<?php
include_once '../php-ofc-library/open-flash-chart.php';
$x_labels = array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','N
ov','Dec');
$title = new title( "Total hours on project mayhem" );
$hbar = new hbar( '#86BBEF' );
$hbar->set_tooltip( 'Months: #val#' );
$hbar->set_values( array(4,8,3,4,7,8) );
$chart = new open_flash_chart();
$chart->set_title( $title );
$chart->add_element( $hbar );
$x = new x_axis();
$x->set_offset( false );
$x->set_range( 0, 10 );
//$x->set_labels_from_array( $x_labels );
$chart->set_x_axis( $x );
$y = new y_axis();
$y->set_offset( true );
$y->set_labels( array( "Jeff","Geoff","Bob","Terry","Duncan","monk.e.boy" ) );
$chart->add_y_axis( $y );
$tooltip = new tooltip();
//
// LOOK:
//
$tooltip->set_hover();
//
//
//
$tooltip->set_stroke( 1 );
$tooltip->set_colour( "#000000" );
$tooltip->set_background_colour( "#ffffff" );
$chart->set_tooltip( $tooltip );
echo $chart->toPrettyString();
?>
ofc_horisontalbar_tooltip_hover.php
<script type="text/javascript" src="ofc/js/swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF(
"ofc/open-flash-chart.swf", "my_chart",
"400", "250", "9.0.0", "ofc/expressInstall.swf",
{"data-file":"data_ofc_horisontalbar_tooltip_hover.php"} );
</script>
<div id="my_chart"></div>
Hasilnya