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">
"open-flash-chart.swf", "my_chart", "550", "200",
"9.0.0", "expressInstall.swf",
{"data-file":"gallery/tooltip-clash.php"} );
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]


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 titledate("D M d Y") );

$d = new hollow_dot();

$line_1 = new line();
$line_1->set_values$data_1 );
$line_1->set_colour"#FF0000" );
$line_1->set_tooltip("#val#<br>Red [#x_label#]");

$d2 = new hollow_dot();

$line_2 = new line();
$line_2->set_values$data_2 );
$line_2->set_colour"#00FF00" );
$line_2->set_tooltip("#val#<br>Green [#x_label#]");

$d3 = new hollow_dot();

$line_3 = new line();
$line_3->set_values$data_3 );
$line_3->set_colour"#0000FF" );
$line_3->set_tooltip("#val#<br>Blue [#x_label#]");

$y = new y_axis();

$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 );

To see the data produced : gallery/tooltip-clash.php, then 'view source'.
Support This Project

Open Flash Chart logo by | Syntax highlights are by GeSHi