Chart Elements - Tooltip - Tooltip Clash
A simple little example showing how the tooltips cope when many data points
share the same location.
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/tooltip-clash.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/tooltip-clash.php
<?php
include '../php-ofc-library/open-flash-chart.php';
$data_1 = array(7,6,7,8,8); $data_2 = array(7,8,7,6,6); $data_3 = array(3,4,7,3,3);
$title = new title( date("D M d Y") );
$line_1 = new line_hollow(); $line_1->set_values( $data_1 ); $line_1->set_colour( "#FF0000" ); $line_1->set_halo_size( 0 ); $line_1->set_width( 2 ); $line_1->set_dot_size( 5 ); $line_1->set_tooltip("#val#<br>Red [#x_label#]");
$line_2 = new line_hollow(); $line_2->set_values( $data_2 ); $line_2->set_colour( "#00FF00" ); $line_2->set_halo_size( 1 ); $line_2->set_width( 1 ); $line_2->set_dot_size( 4 ); $line_2->set_tooltip("#val#<br>Green [#x_label#]");
$line_3 = new line_hollow(); $line_3->set_values( $data_3 ); $line_3->set_colour( "#0000FF" ); $line_3->set_halo_size( 1 ); $line_3->set_width( 6 ); $line_3->set_dot_size( 4 ); $line_3->set_tooltip("#val#<br>Blue [#x_label#]");
$y = new y_axis(); $y->set_range( 0, 10, 2 );
$chart = new open_flash_chart(); $chart->set_title( $title ); $chart->add_element( $line_1 ); $chart->add_element( $line_2 ); $chart->add_element( $line_3 ); $chart->set_y_axis( $y );
echo $chart->toPrettyString();
|
|