Gallery - Line and Key
Change the style of the line and of the key text.
Methods: See data lines.
By default the key text is the same colour as the line it labels. Adding a key
moves and resizes the other chart elements.
For details of how we added two lines of data to this chart, see Data Lines.
Create the flash object
<?php include_once 'ofc-library/open_flash_chart_object.php'; open_flash_chart_object( 500, 250, 'http://'. $_SERVER['SERVER_NAME'] .'/open-flash-chart/gallery-data-7.php' ); ?>
gallery-data-7.php
<?php
// generate some random data srand((double)microtime()*1000000);
$data_1 = array(); $data_2 = array(); for( $i=0; $i<13; $i++ ) { $data_1[] = rand(11,19); $data_2[] = rand(1,10); }
include_once( 'ofc-library/open-flash-chart.php' ); $g = new graph();
// line 1: $g->set_data( $data_1 ); // 3 pixels wide line, with a 6 pixel dot (and tooltip) $g->line_dot( 3, 6, '#9933CC', 'Earnings', 18 );
// line 2: $g->set_data( $data_2 ); // 2 pixel line, no dot $g->line( 2, '#50CC33', 'Beer money', 18 );
$g->set_x_labels( $data_2 ); $g->set_y_max( 20 ); $g->title( 'Proffit', '{font-size: 25px; color: #FF8040}' ); echo $g->render(); ?>
|
|