Open Flash Chart
Support This Project :: Home - Gallery - Candle
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 - Candle

Method: candle

candle( array $data, integer $alpha, integer $line_width, string $colour, [, string $text] [, integer $size] )

The data array must be an array of candle objects.

candle( integer $high, integer $open, integer $close, integer $low )

The candle object take four parameters, high, open, close and low. The candle is hollow if it opens higher than it closes.

Note:
The candle adds extra magic options to the tooltip string:

  • #high#
  • #open#
  • #low#
  • #close#
I assume you can figure out what those magic values get replaced with :-)

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-42.php' );
?>
gallery-data-42.php
<?php
include_once( 'ofc-library/open-flash-chart.php' );

$a = array();
$b = array();
$labels = array();

$a[] = new candle(10,8,6,4);
$b[] = new candle(10,8,6,4);
$labels[] = 'Mon';
$a[] = new candle(20,15,10,5);
$b[] = new candle(20,10,15,5);
$labels[] = 'Tue';
$a[] = new candle(20,15,10,5);
$b[] = new candle(28,24,18,16);
$labels[] = 'Wed';
$a[] = new candle(20,10,15,5);
$b[] = new candle(10,6,9,4);
$labels[] = 'Thu';
$a[] = new candle(30,5,27,2);
$b[] = new candle(5,4,2,1);
$labels[] = 'Fri';

//
// ----
//
$g = new graph();
$g->title'candle''{font-size: 26px;}' );

//$g->set_data( $data );

//
// LOOK:
//
$g->candle$a602'#C11B01''My Company'12 );
$g->candle$b602'#B0C101''Your Company'12 );
//
//
$g->set_tool_tip'#x_legend#<br>High: #high#<br>Open: #open#<br>Close: #close#<br>Low: #low#' );
//
//

$g->set_x_labels$labels );
$g->set_x_label_style10'#000000'0);
$g->set_x_legend'Week 1'12'#C11B01' );

$g->set_y_min);
$g->set_y_max30 );

$g->y_label_steps10 );
$g->set_y_legend'Value'12'#C11B01' );
echo 
$g->render();
?>
To see the data produced : gallery-data-42.php, then 'view source'.
Help support the project: Support This Project

Adverts: