Gallery - Area
Area charts. These are almost identical to line charts.
Method: area_hollow
area_hollow( $width, $dot_size, $alpha, $colour [, $text=''][, $font_size=''][, $fill_colour] )
For $with, $dot_size, $colour, $text and $font_size see data lines .
$alpha is how transparent the area is. 100 is opaque (solid) and 0 is transparent. 50 is 50% etc...
$fill_colour is an optional fill colour. If this is not specified then the $colour is used.
Area charts are used to show volumes of things, e.g. number of people who visited your web site.
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-21.php' ); ?>
gallery-data-21.php
<?php // generate some random data srand ((double) microtime ()* 1000000 ); $data = array(); $labels = array(); for( $i = 0 ; $i < 6.2 ; $i += 0.2 ) { $tmp = sin ( $i ) * 1.9 ; $data [] = $tmp ; // just show to two decimal places // in our labels: $labels [] = number_format ( $tmp , 2 ); } include_once( 'ofc-library/open-flash-chart.php' ); $g = new graph (); $g -> title ( 'Area Chart' , '{font-size: 26px;}' ); $g -> set_data ( $data ); // width: 2px, dots: 3px, area alpha: 25% ... $g -> area_hollow ( 2 , 3 , 25 , '#CC3399' ); $g -> set_x_labels ( $labels ); $g -> set_x_label_style ( 10 , '#9933CC' , 2 , 2 ); $g -> set_x_axis_steps ( 2 ); $g -> set_y_min ( - 2 ); $g -> set_y_max ( 2 ); $g -> y_label_steps ( 4 ); $g -> set_y_legend ( 'Open Flash Chart' , 12 , '#736AFF' ); echo $g -> render (); ?>
Help support the project:
Adverts: