All methods in this package with exception of renderChart method set a various options for the chart.
Below we will list all the methods with its parameter.
Detailed description of the options is in Options chapter.
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 and 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:
Return: instanceAccess: public
array getChartOptions( )
Return all the option for the Chart
API Tags:
Access: public
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 optins 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
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
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
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
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
jqChart 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:
Return: instance
Access: public
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
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
setLegend [line 225]
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
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
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
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:
Return: instance
Access: public
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:
Return: instance
Access: public
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
jqChart setTheme( string $name )
Set the theme of the chart - currently we have the following themes - grid, blue, dark-green, dark-blue. The theme is searched in the current directory, so be a carfully when set the name of the theme. The theme can be set via url something like
$chart->setTheme("http://example.com/grid.js");
Parameters:
- string $name: the name or the url to the theme
API Tags:
Return: instance
Access: public
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
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
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
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