Wizards Toolkit Documentation

Chart.php

Chart functions for Wizards Toolkit

All rights reserved.

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Tags
author
Programming Labs
license
All rights reserved
version
2.0

Table of Contents

wzGraphValues()  : null
Graph Values for Chart.js and MaterializeCSS
wzRptChart()  : html
Single line call to generate multiple charts for a single set of data.

Functions

wzGraphValues()

Graph Values for Chart.js and MaterializeCSS

wzGraphValues ( string  $fncSQL , array<string|int, mixed>  $fncSqlFilter [, string  $fncDateFormat = '' ] ) : null

This can be used to retrieve proper syntax for Chart.js Charts.

Calling method: $pgGraph = wzGraphValues($pgSQL, $pgSqlFilter);

Parameters
$fncSQL : string

SQL SELECT

$fncSqlFilter : array<string|int, mixed>

array that has PDO names of fields and their values

$fncDateFormat : string = ''

If first column is a date you can pass in the format you want the date displayed

Return values
null

wzRptChart()

Single line call to generate multiple charts for a single set of data.

wzRptChart ( string  $fncSQL , array<string|int, mixed>  $fncSqlFilter [, string  $fncRptId = 'wzRpt1' ][, string  $fncDateFormat = '' ] [, array<string|int, mixed>  $fncChartOps = [] ] , string  $fncChartNum) : html

This calls wzBuildDataBrowse to generate a list of data and wzGraphValues to make charts in conjunction with HTML and JS as defined in wz/htm/chartJS.htm.

Calling example:
$pgChartOps = array('regRpt','pie','bar','line');
$pgHtm .= wzRptChart($pgSQL, $pgSqlFilter, $pgRpt . 'Rpt', '', $pgChartOps, $pgRptNum);

Parameters
$fncSQL : string

SQL SELECT

$fncSqlFilter : array<string|int, mixed>

array that has PDO names of fields and their values

$fncRptId : string = 'wzRpt1'

only need to pass if have more than one report on page

$fncDateFormat : string = ''

If first column is a date you can pass in the format you want the date displayed

$fncChartOps : array<string|int, mixed> = []

If not passed then all chart types will be shown; this allows choosing which charts to show.

$fncChartNum : string

defaults to 0 and is used if more than one chart on page

Tags
uses
function

wzBuildDataBrowse

uses
function

wzGraphValues

uses
html

wz/htm/chartJS.htm

Return values
html

and charts

Search results