Open Flash Chart
Support This Project :: Home - Gallery - Y Axis Min Max
Info: Open Flash Chart 2 is out. Version 1.x and these pages will never disappear and the charts will continue working forever, but further development on 1.x has stopped. Take a look at version 2 here Open Flash Chart 2.

Gallery - Y Axis Min Max

Method: set_y_min()

set_y_min( float $min )
$min - min Y value.

Method: set_y_max()

set_y_max( float $max )
$max - max Y value.


Create the flash object
<?php
include_once 'ofc-library/open_flash_chart_object.php';
open_flash_chart_object500300'http://'$_SERVER['SERVER_NAME'] .'/open-flash-chart/gallery-data-19.php' );
?>

gallery-data-19.php
<?php

// generate some random data
srand((double)microtime()*1000000);

$data_1 = array();
$data_2 = array();
for( 
$i=0$i<9$i++ )
{
  
// rand gives us an integer, so devide it
  // by 10 to give us a float number between
  // 5 and 9
  
$data_1[] = rand(50,90)/10;
  
$data_2[] = rand(-50,-90)/10;
}

include_once( 
'ofc-library/open-flash-chart.php' );
$g = new graph();
$g->title'min=-10 max=10''{font-size: 35px; color: #800000}' );

$g->set_data$data_1 );
$g->bar50'#800000''Rusty'10 );

$g->set_data$data_2 );
$g->bar_filled50'#9933CC''#8010A0''Purple Nurple'10 );

$g->set_x_labels( array( 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep' ) );

$g->set_y_min( -9.5 );
$g->set_y_max10.5 );

$g->y_label_steps);
$g->set_y_legend'Your legend here!'12'#736AFF' );
echo 
$g->render();
?>
To see the data produced : gallery-data-19.php, then 'view source'.
Help support the project: Support This Project

Adverts: