Construct graphics in web

Will be used for plotting Open Flash Chart in mind the few of settings, nice graphics and ease of use. One minus of course there is — using flash, but it can be ignored.

Initially, create html strnitsu with the contents:

  1. <body>
  2. <?php
  3. include_once 'open_flash_chart_object.php';
  4. $baseURL = «http://».$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
  5. open_flash_chart_object ( 400, 250, $baseURL.'/chart-data.php', false, $baseURL );
  6. ?>
  7. </body>


Included file open_flash_chart_object.php, and included a flash.
It remains to edit the chart-data.php fit your needs.
<?php
...



...
// connect class with some functions
// for construct a graph
include_once ( 'open-flash-chart.php' );
$g = new graph ();

// Header
$g->title ( 'Total clicks', '{font-size: 26px;}' );

// again add data
$g->set_data ( $data );
// construct graph
$g->line_dot ( 3, 5, '#CC3399', 'Total clicks', 10 );

// signatures on axis X
$labelsX = array ();
for ($i = 1; $i <= 31; $i++) {
$labelsX[] = $i;
}
$g->set_x_labels ($labelsX);

//min and max values on axis Y
$g->set_y_max ( $max+5 );
$g->set_y_min ( 0 );
// number of tags on axis Y
$g->y_label_steps ( 12 );

// displayed data
echo $g->render ();
...

...
?>


Archive with files hear