Initial commit
This commit is contained in:
88
OLD/jpowered/demo/examples/data/configFile.txt
Normal file
88
OLD/jpowered/demo/examples/data/configFile.txt
Normal 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
|
||||
97
OLD/jpowered/demo/examples/data/configFileMultiScale.txt
Normal file
97
OLD/jpowered/demo/examples/data/configFileMultiScale.txt
Normal 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
|
||||
114
OLD/jpowered/demo/examples/data/csvConfig.php
Normal file
114
OLD/jpowered/demo/examples/data/csvConfig.php
Normal 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
|
||||
11
OLD/jpowered/demo/examples/data/csvData.csv
Normal file
11
OLD/jpowered/demo/examples/data/csvData.csv
Normal 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
|
||||
|
36
OLD/jpowered/demo/examples/data/csvdataScript.php
Normal file
36
OLD/jpowered/demo/examples/data/csvdataScript.php
Normal 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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
15
OLD/jpowered/demo/examples/data/dataFile.txt
Normal file
15
OLD/jpowered/demo/examples/data/dataFile.txt
Normal 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
|
||||
|
||||
9
OLD/jpowered/demo/examples/data/dataFileMultiScale.txt
Normal file
9
OLD/jpowered/demo/examples/data/dataFileMultiScale.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
data1series1: 82000
|
||||
data2series1: 60000
|
||||
data3series1: 35000
|
||||
data4series1: 20000
|
||||
|
||||
data1series2: 1200
|
||||
data2series2: 2000
|
||||
data3series2: 3500
|
||||
data4series2: 2400
|
||||
55
OLD/jpowered/demo/examples/data/dataFunction.php
Normal file
55
OLD/jpowered/demo/examples/data/dataFunction.php
Normal 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;
|
||||
}
|
||||
57
OLD/jpowered/demo/examples/data/dataFunctionParams.php
Normal file
57
OLD/jpowered/demo/examples/data/dataFunctionParams.php
Normal 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;
|
||||
}
|
||||
33
OLD/jpowered/demo/examples/data/dataScript.php
Normal file
33
OLD/jpowered/demo/examples/data/dataScript.php
Normal 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;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user