Gallery - Y Axis Right
Method: y_right_axis_colour()
y_right_axis_colour( string $colour )
Set the right Y axis colour.
Method: set_y_right_min() and set_y_right_max()
set_y_right_min( integer $min )
set_y_right_max( integer $max )
See Y min max for more details. This method applies the min and max values to the right Y axis, rather than the left.
You can still use minus numbers (e.g. max = 100, min = -100).
Method: attach_to_y_right_axis()
attach_to_y_right_axis( integer $data_number )
This is the important method, it attaches a set of data (a line, area or bar chart) to the right Y axis. You can call this multiple times
to attach more than one set of data to the right Y axis.
Method: set_y_right_legend()
See Y axis legend for all the details.
Create the flash object
<?php include_once 'ofc-library/open_flash_chart_object.php' ; open_flash_chart_object ( 650 , 300 , 'http://' . $_SERVER [ 'SERVER_NAME' ] . '/open-flash-chart/gallery-data-36.php' ); ?>
gallery-data-36.php
<?php include_once( 'ofc-library/open-flash-chart.php' ); $g = new graph (); $g -> title ( 'Users vs. Ram - 24h statistics' , '{color: #7E97A6; font-size: 20; text-align: center}' ); $g -> bg_colour = '#FFFFFF' ; // // This is real irc server data... // // Some data (line 1): $g -> set_data ( array( 289 , 198 , 143 , 126 , 98 , 96 , 124 , 164 , 213 , 238 , 256 , 263 , 265 , 294 , 291 , 289 , 306 , 341 , 353 , 353 , 402 , 419 , 404 , 366 , 309 ) ); $g -> line_dot ( 2 , 4 , '#818D9D' , 'Max Users' , 10 ); // More data (line 2): $g -> set_data ( array( 698 , 1101 , 1324 , 1396 , 1568 , 1571 , 1496 , 1349 , 1140 , 1045 , 966 , 926 , 906 , 754 , 766 , 757 , 672 , 510 , 431 , 436 , 227 , 533 , 566 , 744 , 1004 ) ); $g -> line_hollow ( 2 , 4 , '#164166' , 'Free Ram' , 10 ); // // Attach the second data line (Free Ram) to the right axis: // $g -> attach_to_y_right_axis ( 2 ); // $g -> set_y_max ( 600 ); $g -> set_y_right_max ( 1700 ); // // AXIS COLOURS // $g -> x_axis_colour ( '#818D9D' , '#F0F0F0' ); $g -> y_axis_colour ( '#818D9D' , '#ADB5C7' ); $g -> y_right_axis_colour ( '#164166' ); // // // AXIS LEGENDS // $g -> set_x_legend ( 'My IRC Server' , 12 , '#164166' ); $g -> set_y_legend ( 'Max Users' , 12 , '#164166' ); $g -> set_y_right_legend ( 'Free Ram (MB)' , 12 , '#164166' ); // // // The X Axis labels are the time, 00:00, 01:00, 02:00 etc... // $tmp = array(); for( $i = 0 ; $i < 25 ; $i ++ ) $tmp [] = ( $i < 10 ? '0' . $i : $i ). ':00' ; $g -> set_x_labels ( $tmp ); $g -> set_x_label_style ( 10 , '#164166' , 0 , 3 , '#818D9D' ); // $g -> y_label_steps ( 5 ); $g -> set_tool_tip ( '#key#<br>#val# (#x_label#)' ); echo $g -> render (); ?>