higrid.net


higridCharts\higridCharts
hgChart.php at line 13

Class higridCharts

higridCharts

public abstract class higridCharts

Author:
She Yi [email protected]
Copyright:
HiGrid.net
Version:
2.1

Field Summary
mixed

$version

Constructor Summary
void

__construct(mixed db)

Method Summary
protected void

convertVar(mixed value, mixed type)

protected array

getSQLSerie(string sql, array params, mixed limit, number offset)

Return a array representation of the sql query.

array

getChartOptions()

Return all the option for the Chart

higridCharts

HCsCO(mixed name, mixed mixvalue)

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

higridCharts

HCsCE(string name, string jscode)

Set event listeners for the chart.

higridCharts

setColors(array avalue)

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

higridCharts

setLabels(mixed name, mixed mixvalue)

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

higridCharts

setLanguage(mixed name, mixed mixvalue)

Set a language object.

higridCharts

HCsL(mixed name, mixed mixvalue)

Set the legend.

higridCharts

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

higridCharts

HCsPO(mixed name, array avalue)

Set the plot options for the chart.

higridCharts

HCsST(mixed name, mixed mixvalue)

Set the subtitle of the chart

higridCharts

HCsT(mixed name, mixed mixvalue)

Set the main title of the chart

higridCharts

HCsTT(mixed name, mixed mixvalue)

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

higridCharts

HCsX(mixed name, mixed mixvalue)

Set the X axis or category axis.

higridCharts

HCsY(mixed name, mixed mixvalue)

Set the Y axis or value axis.

higridCharts

HCsE(mixed name, mixed mixvalue)

Set options for the Exporting module

higridCharts

setNavigation(mixed name, mixed mixvalue)

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

higridCharts

HCaS(string name, mixed value, array params, mixed limit, integer offset)

Add a data to the series with a given name.

higridCharts

setSeriesOption(string name, mixed option, mixed value)

Set a various options for a serie.

void

setJSCode(string code)

Put a javascript code after all things are created.

higridCharts

setTheme(string theme)

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

string

HCoP(string div_id, boolean createlem, mixed width, height, string chart)

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

Field Detail

hgChart.php at line 15

version

public mixed $version = '2.1'

Constructor Detail

hgChart.php at line 47

__construct

public void __construct(mixed db)

Method Detail

hgChart.php at line 73

convertVar

protected void convertVar(mixed value, mixed type)

hgChart.php at line 95

getSQLSerie

protected array getSQLSerie(string sql, array params, mixed limit, number offset)

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

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

hgChart.php at line 131

getChartOptions

public array getChartOptions()

Return all the option for the Chart


hgChart.php at line 144

HCsCO

public higridCharts HCsCO(mixed name, mixed mixvalue)

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

Parameters:
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
mixvalue - is the value option in case the name is string
Returns:
instance

hgChart.php at line 170

HCsCE

public higridCharts HCsCE(string name, string jscode)

Set event listeners for the chart.

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

hgChart.php at line 187

setColors

public higridCharts 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:
avalue - values to be set for the colors
Returns:
instance

hgChart.php at line 202

setLabels

public higridCharts setLabels(mixed name, mixed mixvalue)

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

Parameters:
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
mixvalue - a value in case the name is a string
Returns:
instance

hgChart.php at line 228

setLanguage

public higridCharts 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:
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
mixvalue - a value in case the name is a string
Returns:
instance

hgChart.php at line 254

HCsL

public higridCharts HCsL(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:
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
mixvalue - a value option in case the name is a string
Returns:
instance

hgChart.php at line 279

setLoading

public higridCharts 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:
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
mixvalue - a value option in case the name is a string
Returns:
instance

hgChart.php at line 304

HCsPO

public higridCharts HCsPO(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:
name - the name of tyhe option as per documentation
avalue - array of options = key value pair

hgChart.php at line 330

HCsST

public higridCharts HCsST(mixed name, mixed mixvalue)

Set the subtitle of the chart

Parameters:
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
mixvalue - a value option in case the name is a string
Returns:
instance

hgChart.php at line 354

HCsT

public higridCharts HCsT(mixed name, mixed mixvalue)

Set the main title of the chart

Parameters:
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
mixvalue - a value option in case the name is a string
Returns:
instance

hgChart.php at line 379

HCsTT

public higridCharts HCsTT(mixed name, mixed mixvalue)

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

Parameters:
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
mixvalue - a value option in case the name is a string
Returns:
instance

hgChart.php at line 408

HCsX

public higridCharts HCsX(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:
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
mixvalue - a value option in case the name is a string
Returns:
instance

hgChart.php at line 434

HCsY

public higridCharts HCsY(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:
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
mixvalue - a value option in case the name is a string
Returns:
instance

hgChart.php at line 458

HCsE

public higridCharts HCsE(mixed name, mixed mixvalue)

Set options for the Exporting module

Parameters:
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
mixvalue - a value option in case the name is a string
Returns:
instance

hgChart.php at line 483

setNavigation

public higridCharts setNavigation(mixed name, mixed mixvalue)

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

Parameters:
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
mixvalue - a value option in case the name is a string
Returns:
instance

hgChart.php at line 510

HCaS

public higridCharts HCaS(string name, mixed value, array params, mixed limit, integer offset)

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:
name - the name of the chart. This will be displayed in the chart
value - can be array, sql query or java script function.
params - parameters passed to the query in case of SQL data
limit - if set to number the number of records to retrieve
offset - how many records to skip in case of sql.

hgChart.php at line 577

setSeriesOption

public higridCharts setSeriesOption(string name, mixed option, mixed value)

Set a various options for a serie.

Parameters:
name - the name for the serie
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
value - the value of the option value in case the option is a string

hgChart.php at line 606

setJSCode

public 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:
code - - javascript to be executed

hgChart.php at line 617

setTheme

public higridCharts setTheme(string theme)

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

Parameters:
theme - the name of the theme

hgChart.php at line 646

HCoP

public string HCoP(string div_id, boolean createlem, mixed width, height, string chart)

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

Parameters:
div_id - the id of the chart element in the DOM. If empty the default name 'jqchart' is used.
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.
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
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'

higrid.net