include/SugarCharts/JsChart.php
\JsChart
Generic chart
- Parent(s)
- \SugarChart
- Children
- \Jit
Properties
$base_url= 'array()'
array()
Details- Type
- n/a
- Inherited_from
- \SugarChart::$$base_url
$chart_properties= 'array()'
array()
Details- Type
- n/a
- Inherited_from
- \SugarChart::$$chart_properties
$chart_yAxis= 'array()'
array()
Details- Type
- n/a
- Inherited_from
- \SugarChart::$$chart_yAxis
$colors_list= 'array()'
array()
Details- Type
- n/a
- Inherited_from
- \SugarChart::$$colors_list
$currency_symbol= ''
- Type
- n/a
- Inherited_from
- \SugarChart::$$currency_symbol
$data_set= 'array()'
array()
Details- Type
- n/a
- Inherited_from
- \SugarChart::$$data_set
$db= ''
- Type
- n/a
- Inherited_from
- \SugarChart::$$db
$display_data= 'array()'
array()
Details- Type
- n/a
- Inherited_from
- \SugarChart::$$display_data
$forceHideDataGroupLink= 'false'
false
Details- Type
- n/a
- Inherited_from
- \SugarChart::$$forceHideDataGroupLink
$group_by= 'array()'
array()
Details- Type
- n/a
- Inherited_from
- \SugarChart::$$group_by
$image_export_type= '""'
""
Details- Type
- n/a
- Inherited_from
- \SugarChart::$$image_export_type
$is_currency= ''
- Type
- n/a
- Inherited_from
- \SugarChart::$$is_currency
$print_html_legend_pdf= 'false'
false
Details- Type
- n/a
- Inherited_from
- \SugarChart::$$print_html_legend_pdf
$super_set= 'array()'
array()
Details- Type
- n/a
- Inherited_from
- \SugarChart::$$super_set
$supports_image_export= 'false'
false
Details- Type
- n/a
- Inherited_from
- \SugarChart::$$supports_image_export
$thousands_symbol= ''
- Type
- n/a
- Inherited_from
- \SugarChart::$$thousands_symbol
$url_params= 'array()'
array()
Details- Type
- n/a
- Inherited_from
- \SugarChart::$$url_params
Methods
calculateGroupByTotal(
$dataset
)
:
void
Name | Type | Description |
---|---|---|
$dataset |
calculateSingleBarMax(
$dataset
)
:
void
Name | Type | Description |
---|---|---|
$dataset |
calculateTotal(
\group $group_by
)
:
int
returns the total amount value for the group by field
Inherited from: \SugarChart::calculateTotal()Name | Type | Description |
---|---|---|
$group_by | \group | by field |
Type | Description |
---|---|
int | $total total value |
chartArray(
array $chartsArray
)
:
array
wrapper function to return chart array after any additional processing
Name | Type | Description |
---|---|---|
$chartsArray | array | array of chart config items that need processing |
Type | Description |
---|---|
array | $chartArray after it has been process |
checkYAxis(
\value $value
)
:
\yAxis
Name | Type | Description |
---|---|---|
$value | \value | to check |
Type | Description |
---|---|
\yAxis | min and max |
convertCurrency(
$to_convert
)
:
void
Name | Type | Description |
---|---|---|
$to_convert |
display(
string $name, $xmlFile, $width
=
'320', $height
=
'480', $resize
=
false
)
:
string
wrapper function to return the html code containing the chart in a div
Name | Type | Description |
---|---|---|
$name | string | name of the div string $xmlFile location of the XML file string $style optional additional styles for the div |
$xmlFile | ||
$width | ||
$height | ||
$resize |
Type | Description |
---|---|
string | returns the html code through smarty |
formatNumber(
$number, $decimals
=
null, $decimal_point
=
null, $thousands_sep
=
null
)
:
void
Name | Type | Description |
---|---|---|
$number | ||
$decimals | ||
$decimal_point | ||
$thousands_sep |
generateChartStrings(
string $xmlFile
)
:
\none
generates xml file for Flash charts to use for internationalized instances
Inherited from: \SugarChart::generateChartStrings()Name | Type | Description |
---|---|---|
$xmlFile | string | location of the XML file to write to |
Type | Description |
---|---|
\none |
generateXML(
$xmlDataName
=
false
)
:
string
Name | Type | Description |
---|---|---|
$xmlDataName | none |
Type | Description |
---|---|
string | $xmlContents with xml information |
getData(
$query
)
:
void
Name | Type | Description |
---|---|---|
$query |
getMySugarChartResources(
)
:
void
getXMLFileName(
string $file_id
)
:
void
Name | Type | Description |
---|---|---|
$file_id | string |
|
get_image_cache_file_name(
$xmlFile, $ext
=
".png"
)
:
void
Name | Type | Description |
---|---|---|
$xmlFile | ||
$ext |
nullGroup(
\$sugarSetValue $superSetValue, \$url $url
)
:
void
nullGroup This function sets a null group by clause
Inherited from: \SugarChart::nullGroup()Name | Type | Description |
---|---|---|
$superSetValue | \$sugarSetValue | Mixed value |
$url | \$url | String value of URL for the link |
processDataGroup(
$tablevel, $title, $value, $label, $link
)
:
void
Name | Type | Description |
---|---|---|
$tablevel | ||
$title | ||
$value | ||
$label | ||
$link |
processGauge(
$position, $target, $phases
=
array()
)
:
void
Name | Type | Description |
---|---|---|
$position | ||
$target | ||
$phases |
saveXMLFile(
string $xmlFilename, $xmlContents
)
:
string
Name | Type | Description |
---|---|---|
$xmlFilename | string | location of the xml file string $xmlContents contents of the xml file |
$xmlContents |
Type | Description |
---|---|
string | boolean denoting whether save has failed |
setColors(
$colors
=
array()
)
:
void
Name | Type | Description |
---|---|---|
$colors |
setData(
$dataSet
)
:
void
Name | Type | Description |
---|---|---|
$dataSet |
setDisplayProperty(
$property, $value
)
:
void
Name | Type | Description |
---|---|---|
$property | ||
$value |
setProperties(
$title, $subtitle, $type, $legend
=
'on', $labels
=
'value', $print
=
'on', $thousands
=
false
)
:
void
Name | Type | Description |
---|---|---|
$title | ||
$subtitle | ||
$type | ||
$legend | ||
$labels | ||
$thousands |
sortData(
array $data_set, $keycolname1
=
null, $translate1
=
false, $keycolname2
=
null, $translate2
=
false, $ifsort2
=
false
)
:
\The
This function is used for localize all the characters in the Chart. And it can also sort all the dom_values by the sequence defined in the dom, but this may produce a lot of extra empty data in the xml file, when the chart is sorted by two key cols.
Inherited from: \SugarChart::sortData()If the data quantity is large, it maybe a little slow.
Name | Type | Description |
---|---|---|
$data_set | array | The data get from database string $keycolname1 We will sort by this key first bool $translate1 Whether to trabslate the first column string $keycolname1 We will sort by this key secondly, and it can be null, then it will only sort by the first column. bool $translate1 Whether to trabslate the second column bool $ifsort2 Whether to sort by the second column or just translate the second column. |
$keycolname1 | ||
$translate1 | ||
$keycolname2 | ||
$translate2 | ||
$ifsort2 |
Type | Description |
---|---|
\The | sorted and translated data. |
tab(
string $str, $depth
)
:
string
returns text with tabs appended before it
Name | Type | Description |
---|---|---|
$str | string | input string int $depth number of times to tab |
$depth |
Type | Description |
---|---|
string | with tabs appended before it |
tabValue(
$tag, $value, $depth
)
:
string
Name | Type | Description |
---|---|---|
$tag | ||
$value | ||
$depth |
Type | Description |
---|---|
string | with tabs appended before it |
xmlFooter(
)
:
string
returns the footer for the constructed xml file for sugarcharts
Inherited from: \SugarChart::xmlFooter()Type | Description |
---|---|
string | $footer XML footer |
xmlHeader(
)
:
string
returns the header for the constructed xml file for sugarcharts
Inherited from: \SugarChart::xmlHeader()Type | Description |
---|---|
string | $header XML header |
xmlProperties(
)
:
string
returns the properties tag for the constructed xml file for sugarcharts
Inherited from: \SugarChart::xmlProperties()Type | Description |
---|---|
string | $properties XML properties tag |