PHP Classes

File: linegraph.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Patel Shailesh  >  DbGraph  >  linegraph.php  >  Download  
File: linegraph.php
Role: Example script
Content type: text/plain
Description: Linegraph script
Class: DbGraph
Generate line and 3D bar graphs
Author: By
Last change:
Date: 7 years ago
Size: 1,883 bytes


Class file image Download
/** *********************************************************************************************************************
 * This is main class of graph which can be generate a bar graph or line graph.
 * @author Shailesh Patel
 * @version 1.0
 * Date: 5th March.
 ** *********************************************************************************************************************
include dirname(__FILE__) . "/class.linegraph.php";

$dbHost = 'localhost';
$dbUser = 'root';
$dbPass = '';
$dbName = 'graph';

mysql_connect($dbHost, $dbUser, $dbPass);

$graph = new LineGraph();

/** Data added for line graph pass value of findingsId
$query =mysql_query("SELECT id, val FROM graph_tbl ");
mysql_num_rows($query) > 0)
    while (
$row=mysql_fetch_array($query)) {
$data[$row['id']] = $row['val'];

// below array used in design graph
$graphArray['data'] = $data;
$graphArray['line'] = $line;
$graphArray['graph'] = $graphval;
$graphArray['axis'] = $axis;
$graphArray['scale'] = $scale;