Initial commit

This commit is contained in:
whoisfrost
2026-02-17 13:30:09 -06:00
commit f24a2e2235
404 changed files with 37425 additions and 0 deletions

View File

@@ -0,0 +1,207 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Advanced Graphs and Charts for PHP</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel=STYLESHEET type="text/css" href="../../images/960.css" />
<link rel=STYLESHEET type="text/css" href="../../images/jpprodstyle.css" />
</head>
<body>
<!-- Title area -->
<div class='container_12 header'>
<div class='grid_4'>
<a href='http://www.jpowered.com'><img style='border-width: 0px;' src='../../images/jpowered.gif' width='270' height='60' align='left' alt='JPowered.com' /></a>
</div>
<div class='grid_8 omega product_title'>
<h1>Advanced Graphs and Charts for PHP</h1>
</div>
</div>
<!-- top menu bar -->
<div class='container_12'>
<div class='grid_12 innm'>
<ul>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/">Graph Home</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/buy-now.htm" title="Pricing Options and obtaining License keys">Pricing / License Options</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/demos/" title="View the Online Demos here">Online Demos</a> </li>
<li> <a href="../../documentation/index.htm">Documentation</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/" title="Online Tutorials">Tutorials</a> </li>
</ul>
</div>
</div>
<!-- main content -->
<div class='container_12 main_content'>
<div class='grid_9'>
<h2>Database Interface Script</h2>
<p>Here the graphing software is instructed to dynamically read data from a CSV file.</p>
<p>This method allows you to graph data dynamically straight from a CSV file.</p>
<img src="../../graph/vertical-cylinder-graph.php?
data=../demo/examples/data/csvdataScript.php&
config=../demo/examples/data/csvConfig.php"
width="700"
height="400" />
<p>The graph above is produced using the "Data Interface Script" method with the following IMG tag:-</p>
<textarea class="jpcodeblock" style="width: 600px;">
<img src="../../graph/vertical-cylinder-graph.php?
data=../demo/examples/data/csvdataScript.php&
config=../demo/examples/data/csvConfig.php"
width="700"
height="400" />
</textarea>
<p>The graph data is produced by the interface script and read by the graphing software at runtime:-</p>
<textarea class="jpcodeblock" style="width: 600px;">
./jpowered/demo/examples/data/csvdataScript.php
/*
* read the csv file
*/
$csvdata = file('csvData.csv');
$first = TRUE;
$dataCount = 1;
/*
* process each row of the
* csv file
*/
foreach ($csvdata as $datarow)
{
if ($first) // ignore the first header row
{
$first = FALSE;
}
else
{
/*
* extract the temperature value
* from each row and write out
* the data parameter
*/
$dataelements = explode(',',$datarow);
if (isset($dataelements[1]))
{
$dataelements[1] = (float)$dataelements[1];
print 'data'. $dataCount .'series1: ' . $dataelements[1] . PHP_EOL;
$dataCount++;
}
}
}
</textarea>
<p>With this method the graphing software calls the interface script at runtime and reads the output of the script
in the same way that it would read the data from a flat file. This method allows data to be dynamically produced
and plotted in real-time.</p>
<p>The settings and styles are set from the information contained in the file:-</p>
<textarea class="jpcodeblock" style="width: 600px;">
./jpowered/demo/examples/data/csvConfig.php
</textarea>
<p>If the graph above does not display then see the <a href="../../documentation/troubleShooting.htm">Troubleshooting guide</a> for details on how to resolve the problem.</p>
<p>If the graph above does display but no data is shown then the most likely cause is that the graph is having trouble
connecting to the database server. Ensure that the '<a href='../../sampleApplication/index.php'>Sample Application</a>' has been set up
with the correct DB User credentials.</p>
<p>If you have not yet set up the Sample Application then
you can do so <a href='../../sampleApplication/index.php'>here</a>.</p>
<p>&nbsp;</p>
</div>
<div class='grid_3'>
<p><a href="../../index.htm">Package Index</a></p>
<p><a href="../../documentation/index.htm">Documentation</a></p>
<p><a href="../../documentation/troubleShooting.htm">Troubleshooting Guide</a></p>
<p><a href="http://www.jpowered.com/support.htm">Support</a></p>
<h4>Examples</h4>
<ul>
<li><a href='../examples/dataFiles.htm'>Graphing Data from files</a></li>
<li><a href='../examples/scripts.htm'>Data from external scripts</a></li>
<li><a href='../examples/datafunction.htm'>Custom data function</a></li>
<li><a href='../examples/requestParams.htm'>Utilising request parameters</a></li>
<li><a href='../examples/database.htm'>Plotting data from a database</a></li>
<li><a href='../examples/interface.htm'>Database interface scripts</a></li>
<li><a href='../examples/multiScales.htm'>Multiple Scales, text and images</a></li>
<li><a href='../examples/csvfile.htm'>Graphing CSV files</a></li>
</ul>
<h4>Basic Chart Styles</h4>
<ul>
<li><a href="../../demo/piechart/index.htm">Pie Charts</a></li>
<li><a href="../../demo/xyscatter/index.htm">X-Y Scatter Graphs</a></li>
<li><a href="../../demo/bubblechart/index.htm">Bubble Charts</a></li>
<li><a href="../../demo/areagraph/index.htm">Area Graphs</a></li>
<li><a href="../../demo/linegraph/index.htm">Line Graphs</a></li>
</ul>
<h4>Bar Graphs</h4>
<ul>
<li><a href="../../demo/vbar/index.htm">Vertical Bar Graphs</a></li>
<li><a href="../../demo/svbar/index.htm">Stacked Vertical Bar Graphs</a></li>
<li><a href="../../demo/hbar/index.htm">Horizontal Bar Graphs</a></li>
<li><a href="../../demo/shbar/index.htm">Stacked Horizontal Bar Graphs</a></li>
</ul>
<h4>Cylinder Charts</h4>
<ul>
<li><a href="../../demo/cylinder-Vbar/index.htm">Vertical Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-SVbar/index.htm">Stacked Vertical Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-Hbar/index.htm">Horizontal Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-SHbar/index.htm">Stacked Horizontal Cylinder Graphs</a></li>
</ul>
<h4>Combination Charts</h4>
<ul>
<li><a href="../../demo/combi-Area-SVbar/index.htm">Area and Stacked Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Area-Vbar/index.htm">Area and Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Line-SVbar/index.htm">Line and Stacked Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Line-Vbar/index.htm">Line and Vertical Bar Graph</a></li>
</ul>
<p>&nbsp;</p>
</div>
</div>
<div class='footer'>
<!-- bottom menu bar -->
<div class='container_12'>
<div class='grid_12 innm'>
<ul>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/">Graph Home</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/buy-now.htm" title="Pricing Options and obtaining License keys">Pricing / License Options</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/demos/" title="View the Online Demos here">Online Demos</a> </li>
<li> <a href="../../documentation/index.htm">Documentation</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/" title="Online Tutorials">Tutorials</a> </li>
</ul>
</div>
</div>
<!-- footer -->
<div class='container_12'>
<div class="grid_12 mc">[<a href="http://www.jpowered.com/"> JPowered.com </a>] [<a href="http://www.jpowered.com/products.htm" title="More software components for web applications"> More Products </a>] [<a href="http://www.jpowered.com/support.htm" title="For Help and Support, contact us here">Support </a>]</div>
<div class="grid_12 cprt">Copyright &copy; 2011 - 2014 Neutron Solutions Limited - All rights reserved.</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,88 @@
/* --------------------------------------------------------------------------------------------- */
/* */
/* For the full range of options and parameter meanings please see:- */
/* */
/* http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/configurationOptions.htm */
/* */
/* --------------------------------------------------------------------------------------------- */
width: 700
height: 400
quality: medium
series1: 255,80,30|Product A
series2: 10,122,164|Product B
series3: 150,90,200|Product C
outline: true
gradientfill: true
backgroundcolor: white
grid: true
axis: true
ndecplaces: 0
barwidth: 48
barspacing: 2
chartscale: 2000
chartstarty: 0
gridbgcolor: #444444
axiscolor: grey
floorcolor: gray
gridcolor: gray
gridstyle: dotted
ylabels: true
ylabelfont: Arial
ylabelfontsize: 10
ylabelfontbold: false
ylabelfontitalic: false
ylabelcolor: #444444
y2labelcolor: blue
ylabelpost:
ylabelpre: $
titletext: Product Sales
titlefont: Arial
titlefontsize: 12
titlefontbold: true
titlefontitalic: false
titlecolor: #444444
titleposition: -1,50
xtitletext: Year
xtitlefont: Arial
xtitlefontsize: 11
xtitlefontbold: true
xtitlefontitalic: false
xtitlecolor: #444444
ytitletext: Sales Value
ytitlefont: Arial
ytitlefontsize: 11
ytitlefontbold: true
ytitlefontitalic: false
ytitlecolor: #444444
xlabels: 2008|2009|2010|2011
xlabelorientation: Horizontal
xlabeloffset: 0
xlabelfont: Arial
xlabelfontsize: 10
xlabelfontbold: false
xlabelfontitalic: false
xlabelcolor: #444444
legend: true
legendstyle: horizontal
legendbgcolor: #FFFFFF
legendbordercolor: #FFFFFF
legendtextcolor: #444444
legendtitle:
legendfont: Arial
legendfontsize: 10
legendfontbold: false
legendfontitalic: true

View File

@@ -0,0 +1,97 @@
/* --------------------------------------------------------------------------------------------- */
/* */
/* For the full range of options and parameter meanings please see:- */
/* */
/* http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/configurationOptions.htm */
/* */
/* --------------------------------------------------------------------------------------------- */
width: 700
height: 400
series1: orange|Value of Sales|left|
series2: #9999ff|Sales Volume|right|
outline: true
gradientfill: true
backgroundcolor: white
grid: true
axis: true
3d: true
depth3d: 20
vspace: 25
nrows: 10
ndecplaces: 0
barwidth: 50
barspacing: 10
gridbgcolor: #aaffaa
axiscolor: dark grey
floorcolor: light gray
gridcolor: grey
gridstyle: dotted
titletext: Volume and Values of Sales
titlefont: Arial
titlefontsize: 12
titlefontbold: true
titlefontitalic: false
titlecolor: #555555
titleposition: -1,50
xtitletext:
xtitlefont: Arial
xtitlefontsize: 11
xtitlefontbold: true
xtitlefontitalic: false
xtitlecolor: #993333
ytitletext: Value
ytitlefont: Arial
ytitlefontsize: 11
ytitlefontbold: true
ytitlefontitalic: false
ytitlecolor: #555555
y2titletext: Volume
y2titlefont: Arial
y2titlefontsize: 11
y2titlefontbold: true
y2titlefontitalic: false
y2titlecolor: #555555
xlabels: Quarter 1|Quarter 2|Quarter 3|Quarter 4
xlabelorientation: Down Angle
xlabeloffset: 0
xlabelfont: Arial
xlabelfontsize: 10
xlabelfontbold: false
xlabelfontitalic: false
xlabelcolor: #993333
ylabels: true
ylabelfont: Arial
ylabelfontsize: 9
ylabelfontbold: false
ylabelfontitalic: false
ylabelcolor: #333333
ylabelpost:
ylabelpre: $
y2labels: true
y2labelfont: Arial
y2labelfontsize: 9
y2labelfontbold: false
y2labelfontitalic: false
y2labelcolor: #000088
y2labelpost:
y2labelpre:
legend: false
legendfont: Arial
legendfontsize: 10
legendfontbold: false
legendfontitalic: true

View File

@@ -0,0 +1,114 @@
width: 700
height: 400
quality: medium
series1: 255,80,30|Temperature
outline: true
gradientfill: true
backgroundcolor: white
grid: true
axis: true
ndecplaces: 1
barwidth: 50
barspacing: 2
gridbgcolor: #444444
axiscolor: grey
floorcolor: gray
gridcolor: gray
gridstyle: dotted
ylabels: true
ylabelfont: Arial
ylabelfontsize: 10
ylabelfontbold: false
ylabelfontitalic: false
ylabelcolor: #444444
y2labelcolor: blue
ylabelpost: C
titletext: Temperature
titlefont: Arial
titlefontsize: 12
titlefontbold: true
titlefontitalic: false
titlecolor: #444444
titleposition: -1,50
xtitletext: Date/Time
xtitlefont: Arial
xtitlefontsize: 11
xtitlefontbold: true
xtitlefontitalic: false
xtitlecolor: #444444
ytitletext: Temperature
ytitlefont: Arial
ytitlefontsize: 11
ytitlefontbold: true
ytitlefontitalic: false
ytitlecolor: #444444
<?php
/*
* read the csv file to get the
* X axis date/time labels
*/
$csvdata = file('csvData.csv');
$first = TRUE;
$xlabels = array();
/*
* process each row from the
* csv file
*/
foreach ($csvdata as $datarow)
{
if ($first) // ignore the first header row
{
$first = FALSE;
}
else
{
/*
* extract the Date / Time information
* from the row and place into the
* xlabels array
*/
$dataelements = explode(',',$datarow);
if (isset($dataelements[0]))
{
$xlabels[] = $dataelements[0];
}
}
}
/*
* write out the xlabels parameter
*/
print 'xlabels: '. implode('|',$xlabels);
?>
xlabelorientation: up angle
xlabeloffset: 0
xlabelfont: Arial
xlabelfontsize: 10
xlabelfontbold: false
xlabelfontitalic: false
xlabelcolor: #444444
legend: false
legendstyle: horizontal
legendbgcolor: #FFFFFF
legendbordercolor: #FFFFFF
legendtextcolor: #444444
legendtitle:
legendfont: Arial
legendfontsize: 10
legendfontbold: false
legendfontitalic: true

View File

@@ -0,0 +1,11 @@
Date Time ,Temperature
4/09/2010 13:00, 19.2C
4/09/2010 14:00, 20.1C
4/09/2010 15:00, 22.2C
4/09/2010 16:00, 22.8C
4/09/2010 17:00, 21.2C
4/09/2010 18:00, 20.5C
4/09/2010 19:00, 18.3C
4/09/2010 20:00, 14.2C
4/09/2010 21:00, 10.7C
4/09/2010 22:00, 8.1C
1 Date Time Temperature
2 4/09/2010 13:00 19.2C
3 4/09/2010 14:00 20.1C
4 4/09/2010 15:00 22.2C
5 4/09/2010 16:00 22.8C
6 4/09/2010 17:00 21.2C
7 4/09/2010 18:00 20.5C
8 4/09/2010 19:00 18.3C
9 4/09/2010 20:00 14.2C
10 4/09/2010 21:00 10.7C
11 4/09/2010 22:00 8.1C

View File

@@ -0,0 +1,36 @@
<?php
/*
* read the csv file
*/
$csvdata = file('csvData.csv');
$first = TRUE;
$dataCount = 1;
/*
* process each row of the
* csv file
*/
foreach ($csvdata as $datarow)
{
if ($first) // ignore the first header row
{
$first = FALSE;
}
else
{
/*
* extract the temperature value
* from each row and write out
* the data parameter
*/
$dataelements = explode(',',$datarow);
if (isset($dataelements[1]))
{
$dataelements[1] = (float)$dataelements[1];
print 'data'. $dataCount .'series1: ' . $dataelements[1] . PHP_EOL;
$dataCount++;
}
}
}
?>

View File

@@ -0,0 +1,15 @@
data1series1: 2000
data2series1: 2400
data3series1: 2300
data4series1: 5550
data1series2: 4100
data2series2: 3200
data3series2: 3600
data4series2: 4750
data1series3: 8300
data2series3: 2100
data3series3: 1200
data4series3: 7000

View File

@@ -0,0 +1,9 @@
data1series1: 82000
data2series1: 60000
data3series1: 35000
data4series1: 20000
data1series2: 1200
data2series2: 2000
data3series2: 3500
data4series2: 2400

View File

@@ -0,0 +1,55 @@
<?php
/*
* The graphing software will look for a function named datascript()
* at runtime. If found the graph will call this to acquire the
* graph data.
*/
function datascript () {
/*
* Create the Data Array
*
* We are using a prepopulated array here for simplicity.
* However this method would be used to first acquire data
* from databases, ORM, spreadsheets etc.
*
*/
$dataArray = array('series1' => array(500, 750, 1250, 4300),
'series2' => array(2000, 2100, 2600, 2400),
'series3' => array(8300, 7400, 6200, 3200));
/*
* Convert the data into the array format required
* by the graphing software
*
* The format required is a one dimensional array
* which contains a text for each line of data.
*
*/
$dataLines = array();
/*
* write out the data in the format required for the graphing software
*/
foreach ($dataArray['series1'] as $dataIndex => $dataValue)
{
$dataLines[] = 'data' . ($dataIndex+1) . 'series1: ' . $dataValue;
}
foreach ($dataArray['series2'] as $dataIndex => $dataValue)
{
$dataLines[] = 'data' . ($dataIndex+1) . 'series2: ' . $dataValue;
}
foreach ($dataArray['series3'] as $dataIndex => $dataValue)
{
$dataLines[] = 'data' . ($dataIndex+1) . 'series3: ' . $dataValue;
}
/*
* return the $dataLines array to the
* graphing software
*/
return $dataLines;
}

View File

@@ -0,0 +1,57 @@
<?php
/*
* The graphing software will look for a function named datascript()
* at runtime. If found the graph will call this to acquire the
* graph data.
*/
function datascript () {
/*
* Create the Data Array
*
* Here we demonstrate how the graphs can be used to display
* data based upon the value of request parameters.
*
* In this trivial example we use the value of a request
* parameter to generate the data values.
*
*/
$dataArray = array('series1' => array(50*$_REQUEST['customParam'], 75*$_REQUEST['customParam'], 125*$_REQUEST['customParam'], 430*$_REQUEST['customParam']),
'series2' => array(200*$_REQUEST['customParam'], 210*$_REQUEST['customParam'], 260*$_REQUEST['customParam'], 240*$_REQUEST['customParam']),
'series3' => array(830*$_REQUEST['customParam'], 740*$_REQUEST['customParam'], 620*$_REQUEST['customParam'], 320*$_REQUEST['customParam']));
/*
* Convert the data into the array format required
* by the graphing software
*
* The format required is a one dimensional array
* which contains a text for each line of data.
*
*/
$dataLines = array();
/*
* write out the data in the format required for the graphing software
*/
foreach ($dataArray['series1'] as $dataIndex => $dataValue)
{
$dataLines[] = 'data' . ($dataIndex+1) . 'series1: ' . $dataValue;
}
foreach ($dataArray['series2'] as $dataIndex => $dataValue)
{
$dataLines[] = 'data' . ($dataIndex+1) . 'series2: ' . $dataValue;
}
foreach ($dataArray['series3'] as $dataIndex => $dataValue)
{
$dataLines[] = 'data' . ($dataIndex+1) . 'series3: ' . $dataValue;
}
/*
* return the $dataLines array to the
* graphing software
*/
return $dataLines;
}

View File

@@ -0,0 +1,33 @@
<?php
/*
* Create the Data Array
*
* We are using a prepopulated array here for simplicity.
* However this method would be used to first acquire data
* from databases, ORM, spreadsheets etc.
*
*/
$dataArray = array('series1' => array(500, 750, 1250, 4300),
'series2' => array(2000, 2100, 2600, 2400),
'series3' => array(8300, 7400, 6200, 3200));
/*
* write out the data in the format required for the graphing software
*/
foreach ($dataArray['series1'] as $dataIndex => $dataValue)
{
echo 'data' . ($dataIndex+1) . 'series1: ' . $dataValue . PHP_EOL;
}
foreach ($dataArray['series2'] as $dataIndex => $dataValue)
{
echo 'data' . ($dataIndex+1) . 'series2: ' . $dataValue . PHP_EOL;
}
foreach ($dataArray['series3'] as $dataIndex => $dataValue)
{
echo 'data' . ($dataIndex+1) . 'series3: ' . $dataValue . PHP_EOL;
}
?>

View File

@@ -0,0 +1,171 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Advanced Graphs and Charts for PHP</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel=STYLESHEET type="text/css" href="../../images/960.css" />
<link rel=STYLESHEET type="text/css" href="../../images/jpprodstyle.css" />
</head>
<body>
<!-- Title area -->
<div class='container_12 header'>
<div class='grid_4'>
<a href='http://www.jpowered.com'><img style='border-width: 0px;' src='../../images/jpowered.gif' width='270' height='60' align='left' alt='JPowered.com' /></a>
</div>
<div class='grid_8 omega product_title'>
<h1>Advanced Graphs and Charts for PHP</h1>
</div>
</div>
<!-- top menu bar -->
<div class='container_12'>
<div class='grid_12 innm'>
<ul>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/">Graph Home</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/buy-now.htm" title="Pricing Options and obtaining License keys">Pricing / License Options</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/demos/" title="View the Online Demos here">Online Demos</a> </li>
<li> <a href="../../documentation/index.htm">Documentation</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/" title="Online Tutorials">Tutorials</a> </li>
</ul>
</div>
</div>
<!-- main content -->
<div class='container_12 main_content'>
<div class='grid_9'>
<h2>Data from Files</h2>
<p>The graph below is produced using data and configuration options from plain text files.</p>
<img src="../../graph/vertical-cylinder-graph.php?
data=../demo/examples/data/dataFile.txt&
config=../demo/examples/data/configFile.txt"
width=700
height=400 />
<p>&nbsp;</p>
<p>Here is the IMG tag which invokes the graphing software which dynamically creates the
graph image at page load time.</p>
<textarea class="jpcodeblock" style="width: 600px;">
<img src="../../graph/vertical-cylinder-graph.php?
data=../demo/examples/data/dataFile.txt&
config=../demo/examples/data/configFile.txt"
width=700
height=400 />
</textarea>
<p>Here we tell the software to load the configuration options from the
file <a href='./data/configFile.txt'>configFile.txt</a> and the data
from the file <a href='./data/dataFile.txt'>dataFile.txt</a></p>
<p><strong>Note:</strong> the URLs supplied for both the configuration and
data are relative URLs. The URLs are relative to the location of the
graphing software and NOT this page.</p>
<p>If the graph does not display then see the <a href="../../documentation/troubleShooting.htm">Troubleshooting guide</a> for details on how to resolve the problem.</p>
<p>&nbsp;</p>
</div>
<div class='grid_3'>
<p><a href="../../index.htm">Package Index</a></p>
<p><a href="../../documentation/index.htm">Documentation</a></p>
<p><a href="../../documentation/troubleShooting.htm">Troubleshooting Guide</a></p>
<p><a href="http://www.jpowered.com/support.htm">Support</a></p>
<h4>Examples</h4>
<ul>
<li><a href='../examples/dataFiles.htm'>Graphing Data from files</a></li>
<li><a href='../examples/scripts.htm'>Data from external scripts</a></li>
<li><a href='../examples/datafunction.htm'>Custom data function</a></li>
<li><a href='../examples/requestParams.htm'>Utilising request parameters</a></li>
<li><a href='../examples/database.htm'>Plotting data from a database</a></li>
<li><a href='../examples/interface.htm'>Database interface scripts</a></li>
<li><a href='../examples/multiScales.htm'>Multiple Scales, text and images</a></li>
<li><a href='../examples/csvfile.htm'>Graphing CSV files</a></li>
</ul>
<h4>Basic Chart Styles</h4>
<ul>
<li><a href="../../demo/piechart/index.htm">Pie Charts</a></li>
<li><a href="../../demo/xyscatter/index.htm">X-Y Scatter Graphs</a></li>
<li><a href="../../demo/bubblechart/index.htm">Bubble Charts</a></li>
<li><a href="../../demo/areagraph/index.htm">Area Graphs</a></li>
<li><a href="../../demo/linegraph/index.htm">Line Graphs</a></li>
</ul>
<h4>Bar Graphs</h4>
<ul>
<li><a href="../../demo/vbar/index.htm">Vertical Bar Graphs</a></li>
<li><a href="../../demo/svbar/index.htm">Stacked Vertical Bar Graphs</a></li>
<li><a href="../../demo/hbar/index.htm">Horizontal Bar Graphs</a></li>
<li><a href="../../demo/shbar/index.htm">Stacked Horizontal Bar Graphs</a></li>
</ul>
<h4>Cylinder Charts</h4>
<ul>
<li><a href="../../demo/cylinder-Vbar/index.htm">Vertical Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-SVbar/index.htm">Stacked Vertical Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-Hbar/index.htm">Horizontal Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-SHbar/index.htm">Stacked Horizontal Cylinder Graphs</a></li>
</ul>
<h4>Combination Charts</h4>
<ul>
<li><a href="../../demo/combi-Area-SVbar/index.htm">Area and Stacked Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Area-Vbar/index.htm">Area and Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Line-SVbar/index.htm">Line and Stacked Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Line-Vbar/index.htm">Line and Vertical Bar Graph</a></li>
</ul>
<p>&nbsp;</p>
</div>
</div>
<div class='footer'>
<!-- bottom menu bar -->
<div class='container_12'>
<div class='grid_12 innm'>
<ul>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/">Graph Home</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/buy-now.htm" title="Pricing Options and obtaining License keys">Pricing / License Options</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/demos/" title="View the Online Demos here">Online Demos</a> </li>
<li> <a href="../../documentation/index.htm">Documentation</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/" title="Online Tutorials">Tutorials</a> </li>
</ul>
</div>
</div>
<!-- footer -->
<div class='container_12'>
<div class="grid_12 mc">[<a href="http://www.jpowered.com/"> JPowered.com </a>] [<a href="http://www.jpowered.com/products.htm" title="More software components for web applications"> More Products </a>] [<a href="http://www.jpowered.com/support.htm" title="For Help and Support, contact us here">Support </a>]</div>
<div class="grid_12 cprt">Copyright &copy; 2011 - 2014 Neutron Solutions Limited - All rights reserved.</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,216 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Advanced Graphs and Charts for PHP</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel=STYLESHEET type="text/css" href="../../images/960.css" />
<link rel=STYLESHEET type="text/css" href="../../images/jpprodstyle.css" />
</head>
<body>
<!-- Title area -->
<div class='container_12 header'>
<div class='grid_4'>
<a href='http://www.jpowered.com'><img style='border-width: 0px;' src='../../images/jpowered.gif' width='270' height='60' align='left' alt='JPowered.com' /></a>
</div>
<div class='grid_8 omega product_title'>
<h1>Advanced Graphs and Charts for PHP</h1>
</div>
</div>
<!-- top menu bar -->
<div class='container_12'>
<div class='grid_12 innm'>
<ul>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/">Graph Home</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/buy-now.htm" title="Pricing Options and obtaining License keys">Pricing / License Options</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/demos/" title="View the Online Demos here">Online Demos</a> </li>
<li> <a href="../../documentation/index.htm">Documentation</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/" title="Online Tutorials">Tutorials</a> </li>
</ul>
</div>
</div>
<!-- main content -->
<div class='container_12 main_content'>
<div class='grid_9'>
<h2>Plotting Data from a Database</h2>
<p>In this example the graph is configured to read and plot data directly from a database. </p>
<p>This example requires that the '<a href='../../sampleApplication/index.php'>Sample Application</a>' has been set up. Setting up the Sample Application
will create a database populated with data for use by this example. If you have not yet set up the Sample Application then
you can do so <a href='../../sampleApplication/index.php'>here</a>.</p>
<!-- NOTE: the dbinfo and config file paths are relative to the graph code not the page -->
<img src="../../graph/vertical-bar-graph.php?
dbinfo=../sampleApplication/dataQueries/salesByMonthDB.php&
config=../sampleApplication/graphConfig/salesByMonthConfig.txt"
width="700"
height="400" />
<p>The graph above is produced using the "Database Info" method with the following IMG tag:-</p>
<textarea class="jpcodeblock" style="width: 600px;">
<img src="../graph/vertical-bar-graph.php?
dbinfo=../sampleApplication/dataQueries/salesByMonthDB.php&
config=../sampleApplication/graphConfig/salesByMonthConfig.txt"
width="700"
height="400" />
</textarea>
<p>The graph data is read directly from the database using the information contained in the file:-</p>
<textarea class="jpcodeblock" style="width: 600px;">
/sampleApplication/dataQueries/salesByMonthDB.php
// Data Queries
$jpDatabase["data"] = array();
// Blue Robots
$jpDatabase["data"][0]["query"] = "SELECT SUM(amount) AS monthAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '1'
GROUP BY saleMonth
ORDER BY saleMonth ";
$jpDatabase["data"][0]["valueField"] = "monthAmount";
// Green Robots
$jpDatabase["data"][1]["query"] = "SELECT SUM(amount) AS monthAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '2'
GROUP BY saleMonth
ORDER BY saleMonth ";
$jpDatabase["data"][1]["valueField"] = "monthAmount";
// Red Robots
$jpDatabase["data"][2]["query"] = "SELECT SUM(amount) AS monthAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '3'
GROUP BY saleMonth
ORDER BY saleMonth ";
$jpDatabase["data"][2]["valueField"] = "monthAmount";
// Yellow Robots
$jpDatabase["data"][3]["query"] = "SELECT SUM(amount) AS monthAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '4'
GROUP BY saleMonth
ORDER BY saleMonth ";
$jpDatabase["data"][3]["valueField"] = "monthAmount";
</textarea>
<p>With this method queries for each series of data are entered into the $jpDatabase["data"] array. At page view
time the graphing software will dynamically include this file and execute the queries to produce the
graph in real-time.</p>
<p>The settings and styles are set from the information contained in the file:-</p>
<textarea class="jpcodeblock" style="width: 600px;">
/sampleApplication/graphConfig/salesByMonthConfig.txt
</textarea>
<p>If the graph above does not display then see the <a href="../../documentation/troubleShooting.htm">Troubleshooting guide</a> for details on how to resolve the problem.</p>
<p>If the graph above does display but no data is shown then the most likely cause is that the graph is having trouble
connecting to the database server. Ensure that the '<a href='../../sampleApplication/index.php'>Sample Application</a>' has been set up
with the correct DB User credentials.</p>
<p>If you have not yet set up the Sample Application then
you can do so <a href='../../sampleApplication/index.php'>here</a>.</p>
<p>&nbsp;</p>
</div>
<div class='grid_3'>
<p><a href="../../index.htm">Package Index</a></p>
<p><a href="../../documentation/index.htm">Documentation</a></p>
<p><a href="../../documentation/troubleShooting.htm">Troubleshooting Guide</a></p>
<p><a href="http://www.jpowered.com/support.htm">Support</a></p>
<h4>Examples</h4>
<ul>
<li><a href='../examples/dataFiles.htm'>Graphing Data from files</a></li>
<li><a href='../examples/scripts.htm'>Data from external scripts</a></li>
<li><a href='../examples/datafunction.htm'>Custom data function</a></li>
<li><a href='../examples/requestParams.htm'>Utilising request parameters</a></li>
<li><a href='../examples/database.htm'>Plotting data from a database</a></li>
<li><a href='../examples/interface.htm'>Database interface scripts</a></li>
<li><a href='../examples/multiScales.htm'>Multiple Scales, text and images</a></li>
<li><a href='../examples/csvfile.htm'>Graphing CSV files</a></li>
</ul>
<h4>Basic Chart Styles</h4>
<ul>
<li><a href="../../demo/piechart/index.htm">Pie Charts</a></li>
<li><a href="../../demo/xyscatter/index.htm">X-Y Scatter Graphs</a></li>
<li><a href="../../demo/bubblechart/index.htm">Bubble Charts</a></li>
<li><a href="../../demo/areagraph/index.htm">Area Graphs</a></li>
<li><a href="../../demo/linegraph/index.htm">Line Graphs</a></li>
</ul>
<h4>Bar Graphs</h4>
<ul>
<li><a href="../../demo/vbar/index.htm">Vertical Bar Graphs</a></li>
<li><a href="../../demo/svbar/index.htm">Stacked Vertical Bar Graphs</a></li>
<li><a href="../../demo/hbar/index.htm">Horizontal Bar Graphs</a></li>
<li><a href="../../demo/shbar/index.htm">Stacked Horizontal Bar Graphs</a></li>
</ul>
<h4>Cylinder Charts</h4>
<ul>
<li><a href="../../demo/cylinder-Vbar/index.htm">Vertical Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-SVbar/index.htm">Stacked Vertical Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-Hbar/index.htm">Horizontal Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-SHbar/index.htm">Stacked Horizontal Cylinder Graphs</a></li>
</ul>
<h4>Combination Charts</h4>
<ul>
<li><a href="../../demo/combi-Area-SVbar/index.htm">Area and Stacked Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Area-Vbar/index.htm">Area and Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Line-SVbar/index.htm">Line and Stacked Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Line-Vbar/index.htm">Line and Vertical Bar Graph</a></li>
</ul>
<p>&nbsp;</p>
</div>
</div>
<div class='footer'>
<!-- bottom menu bar -->
<div class='container_12'>
<div class='grid_12 innm'>
<ul>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/">Graph Home</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/buy-now.htm" title="Pricing Options and obtaining License keys">Pricing / License Options</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/demos/" title="View the Online Demos here">Online Demos</a> </li>
<li> <a href="../../documentation/index.htm">Documentation</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/" title="Online Tutorials">Tutorials</a> </li>
</ul>
</div>
</div>
<!-- footer -->
<div class='container_12'>
<div class="grid_12 mc">[<a href="http://www.jpowered.com/"> JPowered.com </a>] [<a href="http://www.jpowered.com/products.htm" title="More software components for web applications"> More Products </a>] [<a href="http://www.jpowered.com/support.htm" title="For Help and Support, contact us here">Support </a>]</div>
<div class="grid_12 cprt">Copyright &copy; 2011 - 2014 Neutron Solutions Limited - All rights reserved.</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,250 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Advanced Graphs and Charts for PHP</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel=STYLESHEET type="text/css" href="../../images/960.css" />
<link rel=STYLESHEET type="text/css" href="../../images/jpprodstyle.css" />
</head>
<body>
<!-- Title area -->
<div class='container_12 header'>
<div class='grid_4'>
<a href='http://www.jpowered.com'><img style='border-width: 0px;' src='../../images/jpowered.gif' width='270' height='60' align='left' alt='JPowered.com' /></a>
</div>
<div class='grid_8 omega product_title'>
<h1>Advanced Graphs and Charts for PHP</h1>
</div>
</div>
<!-- top menu bar -->
<div class='container_12'>
<div class='grid_12 innm'>
<ul>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/">Graph Home</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/buy-now.htm" title="Pricing Options and obtaining License keys">Pricing / License Options</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/demos/" title="View the Online Demos here">Online Demos</a> </li>
<li> <a href="../../documentation/index.htm">Documentation</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/" title="Online Tutorials">Tutorials</a> </li>
</ul>
</div>
</div>
<!-- main content -->
<div class='container_12 main_content'>
<div class='grid_9'>
<h2>Included Data Function</h2>
<p>The graphing software will allow you to write your own data functions
which are then dynamically included at runtime. As with the external data script
method this allows data to be acquired in real time from any source including
databases, spreadsheets etc.</p>
<p>An advantage of this method is that all <strong>$_REQUEST</strong> and
<strong>$_SESSION</strong> variables are available for use within the function
at runtime. This allows data to be dynamically selected based upon data stored by your
application in the session or sent on the request object.</p>
<img src="../../graph/vertical-cylinder-graph.php?
datascript=../demo/examples/data/dataFunction.php&
config=../demo/examples/data/configFile.txt"
width=700
height=400 />
<p>&nbsp;</p>
<p>Here is the IMG tag which invokes the graphing software which dynamically creates the
graph image at page load time.</p>
<textarea class="jpcodeblock" style="width: 600px;">
<img src="../../graph/vertical-cylinder-graph.php?
datascript=../demo/examples/data/dataFunction.php&
config=../demo/examples/data/configFile.txt"
width=700
height=400 />
</textarea>
<p>Here we tell the software to load the configuration options from the
file <a href='./data/configFile.txt'>configFile.txt</a> and include the data
function dataFunction.php (code below)</p>
<textarea class="jpcodeblock" style="width: 600px; height: 400px;">
/*
* The graphing software will look for a function named datascript()
* at runtime. If found the graph will call this to acquire the
* graph data.
*/
function datascript () {
/*
* Create the Data Array
*
* We are using a prepopulated array here for simplicity.
* However this method would be used to first acquire data
* from databases, ORM, spreadsheets etc.
*
*/
$dataArray = array('series1' => array(500, 750, 1250, 4300),
'series2' => array(2000, 2100, 2600, 2400),
'series3' => array(8300, 7400, 6200, 3200));
/*
* Convert the data into the array format required
* by the graphing software
*
* The format required is a one dimensional array
* which contains a text for each line of data.
*
*/
$dataLines = array();
/*
* write out the data in the format required for the graphing software
*/
foreach ($dataArray['series1'] as $dataIndex => $dataValue)
{
$dataLines[] = 'data' . ($dataIndex+1) . 'series1: ' . $dataValue;
}
foreach ($dataArray['series2'] as $dataIndex => $dataValue)
{
$dataLines[] = 'data' . ($dataIndex+1) . 'series2: ' . $dataValue;
}
foreach ($dataArray['series3'] as $dataIndex => $dataValue)
{
$dataLines[] = 'data' . ($dataIndex+1) . 'series3: ' . $dataValue;
}
/*
* return the $dataLines array to the
* graphing software
*/
return $dataLines;
}
</textarea>
<p><strong>Note:</strong> if a closing PHP tag (?&gt;)is added at the end
of the data function file then it is vital that no characters appear
after that tag. If even a space character exists then the graphing
image will not be produced. It is recommend that the closing PHP tag is
omitted.</p>
<p><strong>Note:</strong> the URLs supplied for both the configuration and
data are relative URLs. The URLs are relative to the location of the
graphing software and NOT this page.</p>
<p>If the graph does not display then see the <a href="../../documentation/troubleShooting.htm">Troubleshooting guide</a> for details on how to resolve the problem.</p>
<p>&nbsp;</p>
</div>
<div class='grid_3'>
<p><a href="../../index.htm">Package Index</a></p>
<p><a href="../../documentation/index.htm">Documentation</a></p>
<p><a href="../../documentation/troubleShooting.htm">Troubleshooting Guide</a></p>
<p><a href="http://www.jpowered.com/support.htm">Support</a></p>
<h4>Examples</h4>
<ul>
<li><a href='../examples/dataFiles.htm'>Graphing Data from files</a></li>
<li><a href='../examples/scripts.htm'>Data from external scripts</a></li>
<li><a href='../examples/datafunction.htm'>Custom data function</a></li>
<li><a href='../examples/requestParams.htm'>Utilising request parameters</a></li>
<li><a href='../examples/database.htm'>Plotting data from a database</a></li>
<li><a href='../examples/interface.htm'>Database interface scripts</a></li>
<li><a href='../examples/multiScales.htm'>Multiple Scales, text and images</a></li>
<li><a href='../examples/csvfile.htm'>Graphing CSV files</a></li>
</ul>
<h4>Basic Chart Styles</h4>
<ul>
<li><a href="../../demo/piechart/index.htm">Pie Charts</a></li>
<li><a href="../../demo/xyscatter/index.htm">X-Y Scatter Graphs</a></li>
<li><a href="../../demo/bubblechart/index.htm">Bubble Charts</a></li>
<li><a href="../../demo/areagraph/index.htm">Area Graphs</a></li>
<li><a href="../../demo/linegraph/index.htm">Line Graphs</a></li>
</ul>
<h4>Bar Graphs</h4>
<ul>
<li><a href="../../demo/vbar/index.htm">Vertical Bar Graphs</a></li>
<li><a href="../../demo/svbar/index.htm">Stacked Vertical Bar Graphs</a></li>
<li><a href="../../demo/hbar/index.htm">Horizontal Bar Graphs</a></li>
<li><a href="../../demo/shbar/index.htm">Stacked Horizontal Bar Graphs</a></li>
</ul>
<h4>Cylinder Charts</h4>
<ul>
<li><a href="../../demo/cylinder-Vbar/index.htm">Vertical Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-SVbar/index.htm">Stacked Vertical Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-Hbar/index.htm">Horizontal Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-SHbar/index.htm">Stacked Horizontal Cylinder Graphs</a></li>
</ul>
<h4>Combination Charts</h4>
<ul>
<li><a href="../../demo/combi-Area-SVbar/index.htm">Area and Stacked Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Area-Vbar/index.htm">Area and Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Line-SVbar/index.htm">Line and Stacked Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Line-Vbar/index.htm">Line and Vertical Bar Graph</a></li>
</ul>
<p>&nbsp;</p>
</div>
</div>
<div class='footer'>
<!-- bottom menu bar -->
<div class='container_12'>
<div class='grid_12 innm'>
<ul>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/">Graph Home</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/buy-now.htm" title="Pricing Options and obtaining License keys">Pricing / License Options</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/demos/" title="View the Online Demos here">Online Demos</a> </li>
<li> <a href="../../documentation/index.htm">Documentation</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/" title="Online Tutorials">Tutorials</a> </li>
</ul>
</div>
</div>
<!-- footer -->
<div class='container_12'>
<div class="grid_12 mc">[<a href="http://www.jpowered.com/"> JPowered.com </a>] [<a href="http://www.jpowered.com/products.htm" title="More software components for web applications"> More Products </a>] [<a href="http://www.jpowered.com/support.htm" title="For Help and Support, contact us here">Support </a>]</div>
<div class="grid_12 cprt">Copyright &copy; 2011 - 2014 Neutron Solutions Limited - All rights reserved.</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,256 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Advanced Graphs and Charts for PHP</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel=STYLESHEET type="text/css" href="../../images/960.css" />
<link rel=STYLESHEET type="text/css" href="../../images/jpprodstyle.css" />
</head>
<body>
<!-- Title area -->
<div class='container_12 header'>
<div class='grid_4'>
<a href='http://www.jpowered.com'><img style='border-width: 0px;' src='../../images/jpowered.gif' width='270' height='60' align='left' alt='JPowered.com' /></a>
</div>
<div class='grid_8 omega product_title'>
<h1>Advanced Graphs and Charts for PHP</h1>
</div>
</div>
<!-- top menu bar -->
<div class='container_12'>
<div class='grid_12 innm'>
<ul>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/">Graph Home</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/buy-now.htm" title="Pricing Options and obtaining License keys">Pricing / License Options</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/demos/" title="View the Online Demos here">Online Demos</a> </li>
<li> <a href="../../documentation/index.htm">Documentation</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/" title="Online Tutorials">Tutorials</a> </li>
</ul>
</div>
</div>
<!-- main content -->
<div class='container_12 main_content'>
<div class='grid_9'>
<h2>Database Interface Script</h2>
<p>Here the graphing software is instructed to dynamically call at runtime a custom data script.</p>
<p>This method allows you to create your own PHP Scripts to produce the data to be graphed. This method
can be used to acquire data from a database or any other data source to which your PHP environment has access.</p>
<img src="../../graph/vertical-bar-graph.php?
data=../sampleApplication/dataQueries/dataInterfaceScript.php&
config=../sampleApplication/graphConfig/salesByMonthConfig.txt"
width="700"
height="400" />
<p>The graph above is produced using the "Data Interface Script" method with the following IMG tag:-</p>
<textarea class="jpcodeblock" style="width: 600px;">
<img src="../../graph/vertical-bar-graph.php?
data=../sampleApplication/dataQueries/dataInterfaceScript.php&
config=../sampleApplication/graphConfig/salesByMonthConfig.txt"
width="700"
height="400" />
</textarea>
<p>The graph data is produced by the interface script and read by the graphing software at runtime:-</p>
<textarea class="jpcodeblock" style="width: 600px;">
/sampleApplication/dataQueries/dataInterfaceScript.php
/*
* perform the query for each series of data
*/
$dataLines = array();
/*
* Blue Robots
*/
$sql = "SELECT SUM(amount) AS monthAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '1'
GROUP BY saleMonth
ORDER BY saleMonth ";
$result = mysql_query($sql, $dbLink);
$dataNum = 1;
while ( $row = mysql_fetch_array($result,MYSQL_ASSOC) ) {
$dataLines[] = "data".$dataNum."series1: ".$row["monthAmount"];
$dataNum++;
}
mysql_free_result($result);
/*
* Green Robots
*/
$sql = "SELECT SUM(amount) AS monthAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '2'
GROUP BY saleMonth
ORDER BY saleMonth ";
$result = mysql_query($sql, $dbLink);
$dataNum = 1;
while ( $row = mysql_fetch_array($result,MYSQL_ASSOC) ) {
$dataLines[] = "data".$dataNum."series2: ".$row["monthAmount"];
$dataNum++;
}
mysql_free_result($result);
/*
* Red Robots
*/
$sql = "SELECT SUM(amount) AS monthAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '3'
GROUP BY saleMonth
ORDER BY saleMonth ";
$result = mysql_query($sql, $dbLink);
$dataNum = 1;
while ( $row = mysql_fetch_array($result,MYSQL_ASSOC) ) {
$dataLines[] = "data".$dataNum."series3: ".$row["monthAmount"];
$dataNum++;
}
mysql_free_result($result);
/*
* Yellow Robots
*/
$sql = "SELECT SUM(amount) AS monthAmount
FROM salesByMonth
WHERE saleYear=2008
AND product_id = '4'
GROUP BY saleMonth
ORDER BY saleMonth ";
$result = mysql_query($sql, $dbLink);
$dataNum = 1;
while ( $row = mysql_fetch_array($result,MYSQL_ASSOC) ) {
$dataLines[] = "data".$dataNum."series4: ".$row["monthAmount"];
$dataNum++;
}
mysql_free_result($result);
/*
* Output the data lines
*/
foreach ($dataLines as $dataLine)
{
print $dataLine . PHP_EOL;
}
</textarea>
<p>With this method the graphing software calls the interface script at runtime and reads the output of the script
in the same way that it would read the data from a flat file. This method allows data to be dynamically produced
and plotted in real-time.</p>
<p>The settings and styles are set from the information contained in the file:-</p>
<textarea class="jpcodeblock" style="width: 600px;">
/sampleApplication/graphConfig/salesByMonthConfig.txt
</textarea>
<p>If the graph above does not display then see the <a href="../../documentation/troubleShooting.htm">Troubleshooting guide</a> for details on how to resolve the problem.</p>
<p>If the graph above does display but no data is shown then the most likely cause is that the graph is having trouble
connecting to the database server. Ensure that the '<a href='../../sampleApplication/index.php'>Sample Application</a>' has been set up
with the correct DB User credentials.</p>
<p>If you have not yet set up the Sample Application then
you can do so <a href='../../sampleApplication/index.php'>here</a>.</p>
<p>&nbsp;</p>
</div>
<div class='grid_3'>
<p><a href="../../index.htm">Package Index</a></p>
<p><a href="../../documentation/index.htm">Documentation</a></p>
<p><a href="../../documentation/troubleShooting.htm">Troubleshooting Guide</a></p>
<p><a href="http://www.jpowered.com/support.htm">Support</a></p>
<h4>Examples</h4>
<ul>
<li><a href='../examples/dataFiles.htm'>Graphing Data from files</a></li>
<li><a href='../examples/scripts.htm'>Data from external scripts</a></li>
<li><a href='../examples/datafunction.htm'>Custom data function</a></li>
<li><a href='../examples/requestParams.htm'>Utilising request parameters</a></li>
<li><a href='../examples/database.htm'>Plotting data from a database</a></li>
<li><a href='../examples/interface.htm'>Database interface scripts</a></li>
<li><a href='../examples/multiScales.htm'>Multiple Scales, text and images</a></li>
<li><a href='../examples/csvfile.htm'>Graphing CSV files</a></li>
</ul>
<h4>Basic Chart Styles</h4>
<ul>
<li><a href="../../demo/piechart/index.htm">Pie Charts</a></li>
<li><a href="../../demo/xyscatter/index.htm">X-Y Scatter Graphs</a></li>
<li><a href="../../demo/bubblechart/index.htm">Bubble Charts</a></li>
<li><a href="../../demo/areagraph/index.htm">Area Graphs</a></li>
<li><a href="../../demo/linegraph/index.htm">Line Graphs</a></li>
</ul>
<h4>Bar Graphs</h4>
<ul>
<li><a href="../../demo/vbar/index.htm">Vertical Bar Graphs</a></li>
<li><a href="../../demo/svbar/index.htm">Stacked Vertical Bar Graphs</a></li>
<li><a href="../../demo/hbar/index.htm">Horizontal Bar Graphs</a></li>
<li><a href="../../demo/shbar/index.htm">Stacked Horizontal Bar Graphs</a></li>
</ul>
<h4>Cylinder Charts</h4>
<ul>
<li><a href="../../demo/cylinder-Vbar/index.htm">Vertical Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-SVbar/index.htm">Stacked Vertical Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-Hbar/index.htm">Horizontal Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-SHbar/index.htm">Stacked Horizontal Cylinder Graphs</a></li>
</ul>
<h4>Combination Charts</h4>
<ul>
<li><a href="../../demo/combi-Area-SVbar/index.htm">Area and Stacked Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Area-Vbar/index.htm">Area and Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Line-SVbar/index.htm">Line and Stacked Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Line-Vbar/index.htm">Line and Vertical Bar Graph</a></li>
</ul>
<p>&nbsp;</p>
</div>
</div>
<div class='footer'>
<!-- bottom menu bar -->
<div class='container_12'>
<div class='grid_12 innm'>
<ul>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/">Graph Home</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/buy-now.htm" title="Pricing Options and obtaining License keys">Pricing / License Options</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/demos/" title="View the Online Demos here">Online Demos</a> </li>
<li> <a href="../../documentation/index.htm">Documentation</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/" title="Online Tutorials">Tutorials</a> </li>
</ul>
</div>
</div>
<!-- footer -->
<div class='container_12'>
<div class="grid_12 mc">[<a href="http://www.jpowered.com/"> JPowered.com </a>] [<a href="http://www.jpowered.com/products.htm" title="More software components for web applications"> More Products </a>] [<a href="http://www.jpowered.com/support.htm" title="For Help and Support, contact us here">Support </a>]</div>
<div class="grid_12 cprt">Copyright &copy; 2011 - 2014 Neutron Solutions Limited - All rights reserved.</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,171 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Advanced Graphs and Charts for PHP</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel=STYLESHEET type="text/css" href="../../images/960.css" />
<link rel=STYLESHEET type="text/css" href="../../images/jpprodstyle.css" />
</head>
<body>
<!-- Title area -->
<div class='container_12 header'>
<div class='grid_4'>
<a href='http://www.jpowered.com'><img style='border-width: 0px;' src='../../images/jpowered.gif' width='270' height='60' align='left' alt='JPowered.com' /></a>
</div>
<div class='grid_8 omega product_title'>
<h1>Advanced Graphs and Charts for PHP</h1>
</div>
</div>
<!-- top menu bar -->
<div class='container_12'>
<div class='grid_12 innm'>
<ul>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/">Graph Home</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/buy-now.htm" title="Pricing Options and obtaining License keys">Pricing / License Options</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/demos/" title="View the Online Demos here">Online Demos</a> </li>
<li> <a href="../../documentation/index.htm">Documentation</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/" title="Online Tutorials">Tutorials</a> </li>
</ul>
</div>
</div>
<!-- main content -->
<div class='container_12 main_content'>
<div class='grid_9'>
<p>In the Vertical Bar Graph below we plot 2 series of data with the first using the left y-axis scales and the second
using the right y-axis scale.</p>
<p>By default all data will be set to plot against the left hand y-axis scale. To override this
and tell the graph software to plot data against a right hand y-axis scale an additional element
is added to the sereisN parameter in the configuration. In this case we tell the graph software to
plot series 2 against the right hand scale by adding the value 'right' to the end of the series
parameter string:-</p>
<p>series2: #993399|Sales Volume|right|</p>
<img src="../../graph/vertical-bar-graph.php?
data=../demo/examples/data/dataFileMultiScale.txt&
config=../demo/examples/data/configFileMultiScale.txt"
width=700
height=400 />
<p>&nbsp;</p>
<p>Here is the IMG tag which invokes the graphing software which dynamically creates the
graph image at page load time.</p>
<textarea class="jpcodeblock" style="width: 600px;">
<img src="../../graph/vertical-bar-graph.php?
data=../demo/examples/data/dataFileMultiScale.txt&
config=../demo/examples/data/configFileMultiScale.txt"
width=700
height=400 />
</textarea>
<p>Here we tell the software to load the configuration options from the
file <a href='./data/configFileMultiScale.txt'>configFileMultiScale.txt</a> and the data
from the file <a href='./data/dataFileMultiScale.txt'>dataFileMultiScale.txt</a></p>
<p><strong>Note:</strong> the URLs supplied for both the configuration and
data are relative URLs. The URLs are relative to the location of the
graphing software and NOT this page.</p>
<p>If the graph does not display then see the <a href="../../documentation/troubleShooting.htm">Troubleshooting guide</a> for details on how to resolve the problem.</p>
<p>&nbsp;</p>
</div>
<div class='grid_3'>
<p><a href="../../index.htm">Package Index</a></p>
<p><a href="../../documentation/index.htm">Documentation</a></p>
<p><a href="../../documentation/troubleShooting.htm">Troubleshooting Guide</a></p>
<p><a href="http://www.jpowered.com/support.htm">Support</a></p>
<h4>Examples</h4>
<ul>
<li><a href='../examples/dataFiles.htm'>Graphing Data from files</a></li>
<li><a href='../examples/scripts.htm'>Data from external scripts</a></li>
<li><a href='../examples/datafunction.htm'>Custom data function</a></li>
<li><a href='../examples/requestParams.htm'>Utilising request parameters</a></li>
<li><a href='../examples/database.htm'>Plotting data from a database</a></li>
<li><a href='../examples/interface.htm'>Database interface scripts</a></li>
<li><a href='../examples/multiScales.htm'>Multiple Scales, text and images</a></li>
<li><a href='../examples/csvfile.htm'>Graphing CSV files</a></li>
</ul>
<h4>Basic Chart Styles</h4>
<ul>
<li><a href="../../demo/piechart/index.htm">Pie Charts</a></li>
<li><a href="../../demo/xyscatter/index.htm">X-Y Scatter Graphs</a></li>
<li><a href="../../demo/bubblechart/index.htm">Bubble Charts</a></li>
<li><a href="../../demo/areagraph/index.htm">Area Graphs</a></li>
<li><a href="../../demo/linegraph/index.htm">Line Graphs</a></li>
</ul>
<h4>Bar Graphs</h4>
<ul>
<li><a href="../../demo/vbar/index.htm">Vertical Bar Graphs</a></li>
<li><a href="../../demo/svbar/index.htm">Stacked Vertical Bar Graphs</a></li>
<li><a href="../../demo/hbar/index.htm">Horizontal Bar Graphs</a></li>
<li><a href="../../demo/shbar/index.htm">Stacked Horizontal Bar Graphs</a></li>
</ul>
<h4>Cylinder Charts</h4>
<ul>
<li><a href="../../demo/cylinder-Vbar/index.htm">Vertical Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-SVbar/index.htm">Stacked Vertical Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-Hbar/index.htm">Horizontal Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-SHbar/index.htm">Stacked Horizontal Cylinder Graphs</a></li>
</ul>
<h4>Combination Charts</h4>
<ul>
<li><a href="../../demo/combi-Area-SVbar/index.htm">Area and Stacked Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Area-Vbar/index.htm">Area and Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Line-SVbar/index.htm">Line and Stacked Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Line-Vbar/index.htm">Line and Vertical Bar Graph</a></li>
</ul>
<p>&nbsp;</p>
</div>
</div>
<div class='footer'>
<!-- bottom menu bar -->
<div class='container_12'>
<div class='grid_12 innm'>
<ul>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/">Graph Home</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/buy-now.htm" title="Pricing Options and obtaining License keys">Pricing / License Options</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/demos/" title="View the Online Demos here">Online Demos</a> </li>
<li> <a href="../../documentation/index.htm">Documentation</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/" title="Online Tutorials">Tutorials</a> </li>
</ul>
</div>
</div>
<!-- footer -->
<div class='container_12'>
<div class="grid_12 mc">[<a href="http://www.jpowered.com/"> JPowered.com </a>] [<a href="http://www.jpowered.com/products.htm" title="More software components for web applications"> More Products </a>] [<a href="http://www.jpowered.com/support.htm" title="For Help and Support, contact us here">Support </a>]</div>
<div class="grid_12 cprt">Copyright &copy; 2011 - 2014 Neutron Solutions Limited - All rights reserved.</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,252 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Advanced Graphs and Charts for PHP</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel=STYLESHEET type="text/css" href="../../images/960.css" />
<link rel=STYLESHEET type="text/css" href="../../images/jpprodstyle.css" />
</head>
<body>
<!-- Title area -->
<div class='container_12 header'>
<div class='grid_4'>
<a href='http://www.jpowered.com'><img style='border-width: 0px;' src='../../images/jpowered.gif' width='270' height='60' align='left' alt='JPowered.com' /></a>
</div>
<div class='grid_8 omega product_title'>
<h1>Advanced Graphs and Charts for PHP</h1>
</div>
</div>
<!-- top menu bar -->
<div class='container_12'>
<div class='grid_12 innm'>
<ul>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/">Graph Home</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/buy-now.htm" title="Pricing Options and obtaining License keys">Pricing / License Options</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/demos/" title="View the Online Demos here">Online Demos</a> </li>
<li> <a href="../../documentation/index.htm">Documentation</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/" title="Online Tutorials">Tutorials</a> </li>
</ul>
</div>
</div>
<!-- main content -->
<div class='container_12 main_content'>
<div class='grid_9'>
<h2>Utilising Request Parameters</h2>
<p>In this example we again use the included data function method but
this time we pass a request parameter through on the IMG tag. The data function
will then produce the graph data based on the value of the request parameter.</p>
<p>This method has a variety of uses including displaying graph data dynamically
based upon user form selection.</p>
<img src="../../graph/vertical-cylinder-graph.php?
datascript=../demo/examples/data/dataFunctionParams.php&
config=../demo/examples/data/configFile.txt&
customParam=8"
width=700
height=400 />
<p>&nbsp;</p>
<p>Here is the IMG tag which invokes the graphing software which dynamically creates the
graph image at page load time.</p>
<textarea class="jpcodeblock" style="width: 600px;">
<img src="../../graph/vertical-cylinder-graph.php?
datascript=../demo/examples/data/dataFunctionParams.php&
config=../demo/examples/data/configFile.txt&
customParam=8"
width=700
height=400 />
</textarea>
<p>Note the extra parameter 'customParam=8' on the IMG tag URL. This is
used by the data function to create the data for the chart.</p>
<p>Here we tell the software to load the configuration options from the
file <a href='./data/configFile.txt'>configFile.txt</a> and include the data
function dataFunctionParams.php (code below)</p>
<textarea class="jpcodeblock" style="width: 600px; height: 400px;">
/*
* The graphing software will look for a function named datascript()
* at runtime. If found the graph will call this to acquire the
* graph data.
*/
function datascript () {
/*
* Create the Data Array
*
* Here we demonstrate how the graphs can be used to display
* data based upon the value of request parameters.
*
* In this trivial example we use the value of a request
* parameter to generate the data values.
*
*/
$dataArray = array('series1' => array(50*$_REQUEST['customParam'], 75*$_REQUEST['customParam'], 125*$_REQUEST['customParam'], 430*$_REQUEST['customParam']),
'series2' => array(200*$_REQUEST['customParam'], 210*$_REQUEST['customParam'], 260*$_REQUEST['customParam'], 240*$_REQUEST['customParam']),
'series3' => array(830*$_REQUEST['customParam'], 740*$_REQUEST['customParam'], 620*$_REQUEST['customParam'], 320*$_REQUEST['customParam']));
/*
* Convert the data into the array format required
* by the graphing software
*
* The format required is a one dimensional array
* which contains a text for each line of data.
*
*/
$dataLines = array();
/*
* write out the data in the format required for the graphing software
*/
foreach ($dataArray['series1'] as $dataIndex => $dataValue)
{
$dataLines[] = 'data' . ($dataIndex+1) . 'series1: ' . $dataValue;
}
foreach ($dataArray['series2'] as $dataIndex => $dataValue)
{
$dataLines[] = 'data' . ($dataIndex+1) . 'series2: ' . $dataValue;
}
foreach ($dataArray['series3'] as $dataIndex => $dataValue)
{
$dataLines[] = 'data' . ($dataIndex+1) . 'series3: ' . $dataValue;
}
/*
* return the $dataLines array to the
* graphing software
*/
return $dataLines;
}
</textarea>
<p><strong>Note:</strong> if a closing PHP tag (?&gt;)is added at the end
of the data function file then it is vital that no characters appear
after that tag. If even a space character exists then the graphing
image will not be produced. It is recommend that the closing PHP tag is
omitted.</p>
<p><strong>Note:</strong> the URLs supplied for both the configuration and
data are relative URLs. The URLs are relative to the location of the
graphing software and NOT this page.</p>
<p>If the graph does not display then see the <a href="../../documentation/troubleShooting.htm">Troubleshooting guide</a> for details on how to resolve the problem.</p>
<p>&nbsp;</p>
</div>
<div class='grid_3'>
<p><a href="../../index.htm">Package Index</a></p>
<p><a href="../../documentation/index.htm">Documentation</a></p>
<p><a href="../../documentation/troubleShooting.htm">Troubleshooting Guide</a></p>
<p><a href="http://www.jpowered.com/support.htm">Support</a></p>
<h4>Examples</h4>
<ul>
<li><a href='../examples/dataFiles.htm'>Graphing Data from files</a></li>
<li><a href='../examples/scripts.htm'>Data from external scripts</a></li>
<li><a href='../examples/datafunction.htm'>Custom data function</a></li>
<li><a href='../examples/requestParams.htm'>Utilising request parameters</a></li>
<li><a href='../examples/database.htm'>Plotting data from a database</a></li>
<li><a href='../examples/interface.htm'>Database interface scripts</a></li>
<li><a href='../examples/multiScales.htm'>Multiple Scales, text and images</a></li>
<li><a href='../examples/csvfile.htm'>Graphing CSV files</a></li>
</ul>
<h4>Basic Chart Styles</h4>
<ul>
<li><a href="../../demo/piechart/index.htm">Pie Charts</a></li>
<li><a href="../../demo/xyscatter/index.htm">X-Y Scatter Graphs</a></li>
<li><a href="../../demo/bubblechart/index.htm">Bubble Charts</a></li>
<li><a href="../../demo/areagraph/index.htm">Area Graphs</a></li>
<li><a href="../../demo/linegraph/index.htm">Line Graphs</a></li>
</ul>
<h4>Bar Graphs</h4>
<ul>
<li><a href="../../demo/vbar/index.htm">Vertical Bar Graphs</a></li>
<li><a href="../../demo/svbar/index.htm">Stacked Vertical Bar Graphs</a></li>
<li><a href="../../demo/hbar/index.htm">Horizontal Bar Graphs</a></li>
<li><a href="../../demo/shbar/index.htm">Stacked Horizontal Bar Graphs</a></li>
</ul>
<h4>Cylinder Charts</h4>
<ul>
<li><a href="../../demo/cylinder-Vbar/index.htm">Vertical Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-SVbar/index.htm">Stacked Vertical Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-Hbar/index.htm">Horizontal Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-SHbar/index.htm">Stacked Horizontal Cylinder Graphs</a></li>
</ul>
<h4>Combination Charts</h4>
<ul>
<li><a href="../../demo/combi-Area-SVbar/index.htm">Area and Stacked Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Area-Vbar/index.htm">Area and Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Line-SVbar/index.htm">Line and Stacked Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Line-Vbar/index.htm">Line and Vertical Bar Graph</a></li>
</ul>
<p>&nbsp;</p>
</div>
</div>
<div class='footer'>
<!-- bottom menu bar -->
<div class='container_12'>
<div class='grid_12 innm'>
<ul>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/">Graph Home</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/buy-now.htm" title="Pricing Options and obtaining License keys">Pricing / License Options</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/demos/" title="View the Online Demos here">Online Demos</a> </li>
<li> <a href="../../documentation/index.htm">Documentation</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/" title="Online Tutorials">Tutorials</a> </li>
</ul>
</div>
</div>
<!-- footer -->
<div class='container_12'>
<div class="grid_12 mc">[<a href="http://www.jpowered.com/"> JPowered.com </a>] [<a href="http://www.jpowered.com/products.htm" title="More software components for web applications"> More Products </a>] [<a href="http://www.jpowered.com/support.htm" title="For Help and Support, contact us here">Support </a>]</div>
<div class="grid_12 cprt">Copyright &copy; 2011 - 2014 Neutron Solutions Limited - All rights reserved.</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,215 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Advanced Graphs and Charts for PHP</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel=STYLESHEET type="text/css" href="../../images/960.css" />
<link rel=STYLESHEET type="text/css" href="../../images/jpprodstyle.css" />
</head>
<body>
<!-- Title area -->
<div class='container_12 header'>
<div class='grid_4'>
<a href='http://www.jpowered.com'><img style='border-width: 0px;' src='../../images/jpowered.gif' width='270' height='60' align='left' alt='JPowered.com' /></a>
</div>
<div class='grid_8 omega product_title'>
<h1>Advanced Graphs and Charts for PHP</h1>
</div>
</div>
<!-- top menu bar -->
<div class='container_12'>
<div class='grid_12 innm'>
<ul>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/">Graph Home</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/buy-now.htm" title="Pricing Options and obtaining License keys">Pricing / License Options</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/demos/" title="View the Online Demos here">Online Demos</a> </li>
<li> <a href="../../documentation/index.htm">Documentation</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/" title="Online Tutorials">Tutorials</a> </li>
</ul>
</div>
</div>
<!-- main content -->
<div class='container_12 main_content'>
<div class='grid_9'>
<h2>Data from External Scripts</h2>
<p>The graph here is produced in a similar manner to the first example except this
time we tell the graphing software to load the data from and external script. This method
is very powerful and allows great scope in the production of real time graphing. An external
script can be used to acquire data dynamically from a wide range of sources including
databases, spreadsheets etc.</p>
<img src="../../graph/vertical-cylinder-graph.php?
data=../demo/examples/data/dataScript.php&
config=../demo/examples/data/configFile.txt"
width=700
height=400 />
<p>&nbsp;</p>
<p>Here is the IMG tag which invokes the graphing software which dynamically creates the
graph image at page load time.</p>
<textarea class="jpcodeblock" style="width: 600px;">
<img src="../../graph/vertical-cylinder-graph.php?
data=../demo/examples/data/dataScript.php&
config=../demo/examples/data/configFile.txt"
width=700
height=400 />
</textarea>
<p>Here we tell the software to load the configuration options from the
file <a href='./data/configFile.txt'>configFile.txt</a> and the data
from the file dataScript.php (code below)</p>
<textarea class="jpcodeblock" style="width: 600px; height: 400px;">
/*
* Create the Data Array
*
* We are using a prepopulated array here for simplicity.
* However this method would be used to first acquire data
* from databases, ORM, spreadsheets etc.
*
*/
$dataArray = array('series1' => array(500, 750, 1250, 4300),
'series2' => array(2000, 2100, 2600, 2400),
'series3' => array(8300, 7400, 6200, 3200));
/*
* write out the data in the format required for the graphing software
*/
foreach ($dataArray['series1'] as $dataIndex => $dataValue)
{
echo 'data' . ($dataIndex+1) . 'series1: ' . $dataValue . PHP_EOL;
}
foreach ($dataArray['series2'] as $dataIndex => $dataValue)
{
echo 'data' . ($dataIndex+1) . 'series2: ' . $dataValue . PHP_EOL;
}
foreach ($dataArray['series3'] as $dataIndex => $dataValue)
{
echo 'data' . ($dataIndex+1) . 'series3: ' . $dataValue . PHP_EOL;
}
</textarea>
<p><strong>Note:</strong> the URLs supplied for both the configuration and
data are relative URLs. The URLs are relative to the location of the
graphing software and NOT this page.</p>
<p>If the graph does not display then see the <a href="../../documentation/troubleShooting.htm">Troubleshooting guide</a> for details on how to resolve the problem.</p>
<p>&nbsp;</p>
</div>
<div class='grid_3'>
<p><a href="../../index.htm">Package Index</a></p>
<p><a href="../../documentation/index.htm">Documentation</a></p>
<p><a href="../../documentation/troubleShooting.htm">Troubleshooting Guide</a></p>
<p><a href="http://www.jpowered.com/support.htm">Support</a></p>
<h4>Examples</h4>
<ul>
<li><a href='../examples/dataFiles.htm'>Graphing Data from files</a></li>
<li><a href='../examples/scripts.htm'>Data from external scripts</a></li>
<li><a href='../examples/datafunction.htm'>Custom data function</a></li>
<li><a href='../examples/requestParams.htm'>Utilising request parameters</a></li>
<li><a href='../examples/database.htm'>Plotting data from a database</a></li>
<li><a href='../examples/interface.htm'>Database interface scripts</a></li>
<li><a href='../examples/multiScales.htm'>Multiple Scales, text and images</a></li>
<li><a href='../examples/csvfile.htm'>Graphing CSV files</a></li>
</ul>
<h4>Basic Chart Styles</h4>
<ul>
<li><a href="../../demo/piechart/index.htm">Pie Charts</a></li>
<li><a href="../../demo/xyscatter/index.htm">X-Y Scatter Graphs</a></li>
<li><a href="../../demo/bubblechart/index.htm">Bubble Charts</a></li>
<li><a href="../../demo/areagraph/index.htm">Area Graphs</a></li>
<li><a href="../../demo/linegraph/index.htm">Line Graphs</a></li>
</ul>
<h4>Bar Graphs</h4>
<ul>
<li><a href="../../demo/vbar/index.htm">Vertical Bar Graphs</a></li>
<li><a href="../../demo/svbar/index.htm">Stacked Vertical Bar Graphs</a></li>
<li><a href="../../demo/hbar/index.htm">Horizontal Bar Graphs</a></li>
<li><a href="../../demo/shbar/index.htm">Stacked Horizontal Bar Graphs</a></li>
</ul>
<h4>Cylinder Charts</h4>
<ul>
<li><a href="../../demo/cylinder-Vbar/index.htm">Vertical Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-SVbar/index.htm">Stacked Vertical Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-Hbar/index.htm">Horizontal Cylinder Graphs</a></li>
<li><a href="../../demo/cylinder-SHbar/index.htm">Stacked Horizontal Cylinder Graphs</a></li>
</ul>
<h4>Combination Charts</h4>
<ul>
<li><a href="../../demo/combi-Area-SVbar/index.htm">Area and Stacked Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Area-Vbar/index.htm">Area and Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Line-SVbar/index.htm">Line and Stacked Vertical Bar Graph</a></li>
<li><a href="../../demo/combi-Line-Vbar/index.htm">Line and Vertical Bar Graph</a></li>
</ul>
<p>&nbsp;</p>
</div>
</div>
<div class='footer'>
<!-- bottom menu bar -->
<div class='container_12'>
<div class='grid_12 innm'>
<ul>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/">Graph Home</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/buy-now.htm" title="Pricing Options and obtaining License keys">Pricing / License Options</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/demos/" title="View the Online Demos here">Online Demos</a> </li>
<li> <a href="../../documentation/index.htm">Documentation</a> </li>
<li> <a href="http://www.jpowered.com/php-scripts/adv-graph-chart/tutorials/" title="Online Tutorials">Tutorials</a> </li>
</ul>
</div>
</div>
<!-- footer -->
<div class='container_12'>
<div class="grid_12 mc">[<a href="http://www.jpowered.com/"> JPowered.com </a>] [<a href="http://www.jpowered.com/products.htm" title="More software components for web applications"> More Products </a>] [<a href="http://www.jpowered.com/support.htm" title="For Help and Support, contact us here">Support </a>]</div>
<div class="grid_12 cprt">Copyright &copy; 2011 - 2014 Neutron Solutions Limited - All rights reserved.</div>
</div>
</div>
</body>
</html>