Charts - Line Charts Menu - Advance Line Dot

Add different data to the graph.

Each dot gets its attributes from the line settings. For example, setting:

	$line_dot->set_dot_size( 3 );
actually sets each dots size attribute to 3. You can override these using dot_value( $value, $colour ) (search the PHP source code to see the methods avaible in this object)

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/adv-line-dot.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/adv-line-dot.php
<?php

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

$data = array();
for( 
$i=0$i<8$i+=0.2 )
{
  
$val sin($i) + 1.5;
  
//
  // OK, lets do something interesting.
  // any value above 1.75 we will plot
  // in RED
  //
  
if( $val 1.75 )
  {
    
$tmp = new dot_value$val'#D02020' );
    
$tmp->set_tooltip('#val#<br>Your text here');
    
$data[] = $tmp;
  }
  else
    
$data[] = $val;
}



$line_dot = new line_dot();
$line_dot->set_width);
$line_dot->set_colour'#DFC329' );
$line_dot->set_dot_size);
$line_dot->set_tooltip'#x_label#:#val#' );
$line_dot->set_values$data );

$y = new y_axis();
$y->set_range03); 

$chart = new open_flash_chart();
$chart->set_title( new title'Advanced dot lines' ) );
$chart->set_y_axis$y );
//
// here we add our data sets to the chart:
//
$chart->add_element$line_dot );

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

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