Gallery - Scatter Chart
You can mix scatter charts with line charts. You can also plot points at any real position, e.g. at 0.5, 0.5
Adding lines in is a little clinky, but it works.
Create the flash object
<?php include_once 'ofc-library/open_flash_chart_object.php'; open_flash_chart_object( 500, 300, 'http://'. $_SERVER['SERVER_NAME'] .'/open-flash-chart/gallery-data-50.php' ); ?>
gallery-data-50.php
<?php include_once( 'ofc-library/open-flash-chart.php' );
$a = array(); $b = array(); $c = array();
$a[] = new point(-0.5,-0.5,5); $a[] = new point(0.5,0.5,5); $a[] = new point(0,0,5);
$b[] = new point(-3,3,5); $b[] = new point(0,3,5); $b[] = new point(3,3,5);
$tmp = -4; for( $i=-5; $i<6; $i++ ) { $c[] = $tmp; $tmp += 0.2; } // // ---- // $g = new graph(); $g->title( 'Mixed Scatter and Line', '{font-size: 23px;}' );
// // LOOK: // $g->scatter( $a, 3, '#736AFF', 'Dot A', 12 ); $g->scatter( $b, 3, '#6AFF73', 'Dot B', 12 );
$g->set_data( $c ); $g->line_hollow( 2, 4, '0x80a033', 'Line', 10 ); // // $g->set_tool_tip( 'x:#x_label#<br>y:#val#' ); // //
$g->set_x_offset( false );
$g->set_y_label_style( 10, '#9933CC' ); $g->y_label_steps(10);
$g->set_x_label_style( 10, '#9933CC' );
$g->set_x_legend( 'I is, like, mixin it up.' );
$g->set_y_min( -5 ); $g->set_y_max( 5 ); $g->set_x_min( -5 ); $g->set_x_max( 5 );
echo $g->render(); ?>
|
|