phpDocumentor jqChart
[ class tree: jqChart ] [ index: jqChart ] [ all elements ]

Class: jqChart

Source Location: /jqChart.php

Class jqChart

Class Overview

Located in /jqChart.php [line 13]



		
				Author(s):
		
  • Tony Tomov, (tony@trirand.com)
API Tags:
Abstract:  A PHP class to work with jqChart jQuery plugin.

Information Tags:
Version:  4.0.0
Copyright:  TriRand Ltd

Properties

Methods

[ Top ]
Property Summary
mixed   $version  

[ Top ]
Method Summary
jqChart   __construct()  
jqChart   addSeries()   Add a data to the series with a given name. If the name exists the data will be overwritten. Data can be added via array, sql query or javascript function
void   convertVar()  
array   getChartOptions()   Return all the option for the Chart
array   getSQLSerie()   Return a array representation of the sql query. Also return only the
string   renderChart()   Main method which construct the chart based on the options set with the previous methods
jqChart   setChartEvent()   Set event listeners for the chart.
jqChart   setChartOptions()   Options regarding the chart area and plot area as well as general chart options.
jqChart   setColors()   Set array containing the default colors for the chart's series.
jqChart   setExporting()   Set options for the Exporting module
void   setJSCode()   Put a javascript code after all things are created. The method is executed only once when the chart is created.
jqChart   setLabels()   Set HTML labels that can be positioined anywhere in the chart area.
jqChart   setLanguage()   Set a language object. The default language is English. For detailed info on the object rehfer to the documentation
jqChart   setLegend()   Set the legend. The legend is a box containing a symbol and name for each series item or point item in the chart.
jqChart   setLoading()   Set the loading options which control the appearance of the loading screen that covers the plot area on chart operations
jqChart   setNavigation()   Set collection of options for buttons and menus appearing in the exporting module.
jqChart   setPlotOptions()   Set the plot options for the chart.
jqChart   setSeriesOption()   Set a various options for a serie.
jqChart   setSubtitle()   Set the subtitle of the chart
jqChart   setTheme()   Set a theme - Can be grid, gray, dark-blue, dark-green
jqChart   setTitle()   Set the main title of the chart
jqChart   setTooltip()   Set options for the tooltip that appears when the user hovers over a series or point
jqChart   setxAxis()   Set the X axis or category axis. Normally this is the horizontal axis, though if the chart is inverted this is the vertical axis.
jqChart   setyAxis()   Set the Y axis or value axis. Normally this is the vertical axis, though if the chart is inverted this is the horiontal axis. In case of multiple axes, the yAxis node is an array of configuration objects.

[ Top ]
Properties
mixed   $version = '4.0.0' [line 15]
API Tags:
Access:  public


[ Top ]
Methods
Constructor __construct  [line 47]

  jqChart __construct( [ $db = null]  )

Parameters:
   $db: 


[ Top ]
addSeries  [line 510]

  jqChart addSeries( string $name, mixed $value, [array $params = null], [mixed $limit = false], [integer $offset = 0]  )

Add a data to the series with a given name. If the name exists the data will be overwritten. Data can be added via array, sql query or javascript function

Parameters:
string   $name:  the name of the chart. This will be displayed in the chart
mixed   $value:  can be array, sql query or java script function.
array   $params:  parameters passed to the query in case of SQL data
mixed   $limit:  if set to number the number of records to retrieve
integer   $offset:  how many records to skip in case of sql.

API Tags:
Access:  public


[ Top ]
convertVar  [line 73]

  void convertVar( $value, $type  )

Parameters:
   $value: 
   $type: 

API Tags:
Access:  protected


[ Top ]
getChartOptions  [line 131]

  array getChartOptions( )

Return all the option for the Chart


API Tags:
Access:  public


[ Top ]
getSQLSerie  [line 95]

  array getSQLSerie( string $sql, [array $params = null], [mixed $limit = false], [number $offset = 0]  )

Return a array representation of the sql query. Also return only the

the values of the first column

Parameters:
string   $sql:  The sql query string
array   $params:  array of parameters passed to the query
mixed   $limit:  the number of records to retrieve. if false - all
number   $offset:  how many record to skip. 0 - none

API Tags:
Return:  of the values of the first column of the query
Access:  protected


[ Top ]
renderChart  [line 646]

  string renderChart( [string $div_id = ''], [boolean $createlem = true], [mixed $width = '800'], [ $height = '400'], [string $chart = 'chart']  )

Main method which construct the chart based on the options set with the previous methods

Parameters:
string   $div_id:  the id of the chart element in the DOM. If empty the default name 'jqchart' is used.
boolean   $createlem:  if set to true a div element is created. If the option is set to false the previous option should be set in order to render the chart to a existing element.
mixed   $width:  set the width of the chart. If a number is used the width is created in pixels. Have sense only if $createlem is true
   $height:  set the height of the chart. If a number is used the height is created in pixels. Have sense only if $createlem is true
string   $chart:  the name which is used when a javascript chart object is created. Can be used later to refer to the chart. The default name is 'chart'

API Tags:
Access:  public


[ Top ]
setChartEvent  [line 170]

  jqChart setChartEvent( string $name, string $jscode  )

Set event listeners for the chart.

Parameters:
string   $name:  The name of the event, Can be click, load, redraw, selection See documentation for more details
string   $jscode:  The javascript code associated with this event

API Tags:
Return:  instance
Access:  public


[ Top ]
setChartOptions  [line 144]

  jqChart setChartOptions( mixed $name, [mixed $mixvalue = '']  )

Options regarding the chart area and plot area as well as general chart options.

Parameters:
mixed   $name:  the option name for the chart. Can be a string or array. When used as array a key value pair should be defined, where the key is the name
mixed   $mixvalue:  is the value option in case the name is string

API Tags:
Return:  instance
Access:  public


[ Top ]
setColors  [line 187]

  jqChart setColors( array $avalue  )

Set array containing the default colors for the chart's series.

When all colors are used, new colors are pulled from the start again. Defaults to: array('#4572A7', '#AA4643', '#89A54E', '#80699B', '#3D96AE', '#DB843D', '#92A8CD', '#A47D7C', '#B5CA92')

Parameters:
array   $avalue:  values to be set for the colors

API Tags:
Return:  instance
Access:  public


[ Top ]
setExporting  [line 458]

  jqChart setExporting( mixed $name, [mixed $mixvalue = '']  )

Set options for the Exporting module

Parameters:
mixed   $name:  the option name for the loading. Can be a string or array. When used as array a key value pair should be defined, where the key is the name
mixed   $mixvalue:  a value option in case the name is a string

API Tags:
Return:  instance
Access:  public


[ Top ]
setJSCode  [line 606]

  void setJSCode( string $code  )

Put a javascript code after all things are created. The method is executed only once when the chart is created.

Parameters:
string   $code:  - javascript to be executed

API Tags:
Access:  public


[ Top ]
setLabels  [line 202]

  jqChart setLabels( mixed $name, [mixed $mixvalue = '']  )

Set HTML labels that can be positioined anywhere in the chart area.

Parameters:
mixed   $name:  the option name for the label. Can be a string or array. When used as array a key value pair should be defined, where the key is the name
mixed   $mixvalue:  a value in case the name is a string

API Tags:
Return:  instance
Access:  public


[ Top ]
setLanguage  [line 228]

  jqChart setLanguage( mixed $name, [mixed $mixvalue = '']  )

Set a language object. The default language is English. For detailed info on the object rehfer to the documentation

Parameters:
mixed   $name:  the option name for the language. Can be a string or array. When used as array a key value pair should be defined, where the key is the name
mixed   $mixvalue:  a value in case the name is a string

API Tags:
Return:  instance
Access:  public


[ Top ]
setLegend  [line 254]

  jqChart setLegend( mixed $name, [mixed $mixvalue = '']  )

Set the legend. The legend is a box containing a symbol and name for each series item or point item in the chart.

Parameters:
mixed   $name:  the option name for the legend. Can be a string or array. When used as array a key value pair should be defined, where the key is the name
mixed   $mixvalue:  a value option in case the name is a string

API Tags:
Return:  instance
Access:  public


[ Top ]
setLoading  [line 279]

  jqChart setLoading( mixed $name, [mixed $mixvalue = '']  )

Set the loading options which control the appearance of the loading screen that covers the plot area on chart operations

Parameters:
mixed   $name:  the option name for the loading. Can be a string or array. When used as array a key value pair should be defined, where the key is the name
mixed   $mixvalue:  a value option in case the name is a string

API Tags:
Return:  instance
Access:  public


[ Top ]
setNavigation  [line 483]

  jqChart setNavigation( mixed $name, [mixed $mixvalue = '']  )

Set collection of options for buttons and menus appearing in the exporting module.

Parameters:
mixed   $name:  the option name for the loading. Can be a string or array. When used as array a key value pair should be defined, where the key is the name
mixed   $mixvalue:  a value option in case the name is a string

API Tags:
Return:  instance
Access:  public


[ Top ]
setPlotOptions  [line 304]

  jqChart setPlotOptions( mixed $name, [array $avalue = '']  )

Set the plot options for the chart.

The plotOptions is a wrapper object for config objects for each series type. The config objects for each series can also be overridden for each series item as given in the series array

Parameters:
mixed   $name:  the name of tyhe option as per documentation
array   $avalue:  array of options = key value pair

API Tags:
Access:  public


[ Top ]
setSeriesOption  [line 577]

  jqChart setSeriesOption( [string $name = ''], [mixed $option = ''], [mixed $value = '']  )

Set a various options for a serie.

Parameters:
string   $name:  the name for the serie
mixed   $option:  can be a array or string. If array a key value pair should be used, where key is the properti value is the optinvalue
mixed   $value:  the value of the option value in case the option is a string

API Tags:
Access:  public


[ Top ]
setSubtitle  [line 330]

  jqChart setSubtitle( mixed $name, [mixed $mixvalue = '']  )

Set the subtitle of the chart

Parameters:
mixed   $name:  the option name for the loading. Can be a string or array. When used as array a key value pair should be defined, where the key is the name
mixed   $mixvalue:  a value option in case the name is a string

API Tags:
Return:  instance
Access:  public


[ Top ]
setTheme  [line 617]

  jqChart setTheme( [string $theme = '']  )

Set a theme - Can be grid, gray, dark-blue, dark-green

Parameters:
string   $theme:  the name of the theme

API Tags:
Access:  public


[ Top ]
setTitle  [line 354]

  jqChart setTitle( mixed $name, [mixed $mixvalue = '']  )

Set the main title of the chart

Parameters:
mixed   $name:  the option name for the loading. Can be a string or array. When used as array a key value pair should be defined, where the key is the name
mixed   $mixvalue:  a value option in case the name is a string

API Tags:
Return:  instance
Access:  public


[ Top ]
setTooltip  [line 379]

  jqChart setTooltip( mixed $name, [mixed $mixvalue = '']  )

Set options for the tooltip that appears when the user hovers over a series or point

Parameters:
mixed   $name:  the option name for the loading. Can be a string or array. When used as array a key value pair should be defined, where the key is the name
mixed   $mixvalue:  a value option in case the name is a string

API Tags:
Return:  instance
Access:  public


[ Top ]
setxAxis  [line 408]

  jqChart setxAxis( mixed $name, [mixed $mixvalue = '']  )

Set the X axis or category axis. Normally this is the horizontal axis, though if the chart is inverted this is the vertical axis.

In case of multiple axes, the xAxis node is an array of configuration objects.

Parameters:
mixed   $name:  the option name for the loading. Can be a string or array. When used as array a key value pair should be defined, where the key is the name
mixed   $mixvalue:  a value option in case the name is a string

API Tags:
Return:  instance
Access:  public


[ Top ]
setyAxis  [line 434]

  jqChart setyAxis( mixed $name, [mixed $mixvalue = '']  )

Set the Y axis or value axis. Normally this is the vertical axis, though if the chart is inverted this is the horiontal axis. In case of multiple axes, the yAxis node is an array of configuration objects.

Parameters:
mixed   $name:  the option name for the loading. Can be a string or array. When used as array a key value pair should be defined, where the key is the name
mixed   $mixvalue:  a value option in case the name is a string

API Tags:
Return:  instance
Access:  public


[ Top ]

Documentation generated on Wed, 22 Jun 2011 14:57:47 +0300 by phpDocumentor 1.4.3