include/SugarCharts/SugarChart.php

Show: inherited
Table of Contents

\SugarChart

Package: SugarCRM

Generic chart

Children
\JsChart
Api
 

Properties

Propertypublic  $base_url= 'array()'
Default valuearray()Details
Type
n/a
Propertypublic  $chart_properties= 'array()'
Default valuearray()Details
Type
n/a
Propertypublic  $chart_yAxis= 'array()'
Default valuearray()Details
Type
n/a
Propertypublic  $colors_list= 'array()'
Default valuearray()Details
Type
n/a
Propertypublic  $currency_symbol= ''
Details
Type
n/a
Propertypublic  $data_set= 'array()'
Default valuearray()Details
Type
n/a
Propertyprivate  $db= ''
Details
Type
n/a
Propertypublic  $display_data= 'array()'
Default valuearray()Details
Type
n/a
Propertypublic  $forceHideDataGroupLink= 'false'
Default valuefalseDetails
Type
n/a
Propertypublic  $group_by= 'array()'
Default valuearray()Details
Type
n/a
Propertypublic  $image_export_type= '""'
Default value""Details
Type
n/a
Propertypublic  $is_currency= ''
Details
Type
n/a
Propertypublic  $print_html_legend_pdf= 'false'
Default valuefalseDetails
Type
n/a
Propertyprotected  $ss= ''
Details
Type
n/a
Propertypublic  $super_set= 'array()'
Default valuearray()Details
Type
n/a
Propertypublic  $supports_image_export= 'false'
Default valuefalseDetails
Type
n/a
Propertypublic  $thousands_symbol= ''
Details
Type
n/a
Propertypublic  $url_params= 'array()'
Default valuearray()Details
Type
n/a

Methods

methodpublic__construct( ) : void

methodpubliccalculateGroupByTotal(  $dataset ) : void

Parameters
Name Type Description
$dataset
methodpubliccalculateSingleBarMax(  $dataset ) : void

Parameters
Name Type Description
$dataset
methodpubliccalculateTotal( \group $group_by ) : int

returns the total amount value for the group by field

Parameters
Name Type Description
$group_by \group

by field

Returns
Type Description
int $total total value
methodpublicchartArray( array $chartsArray ) : array

wrapper function to return chart array after any additional processing

Parameters
Name Type Description
$chartsArray array

array of chart config items that need processing

Returns
Type Description
array $chartArray after it has been process
methodpubliccheckYAxis( \value $value ) : \yAxis

returns correct yAxis min/max

Parameters
Name Type Description
$value \value

to check

Returns
Type Description
\yAxis min and max
methodpublicconstructBaseURL( ) : void

methodpublicconstructURL( ) : void

methodpublicconvertCurrency(  $to_convert ) : void

Parameters
Name Type Description
$to_convert
methodpublicdisplay( string $name,  $xmlFile,  $width = '320',  $height = '480',  $resize = false ) : string

wrapper function to return the html code containing the chart in a div

Parameters
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
Returns
Type Description
string returns the html code through smarty
methodpublicformatNumber(  $number,  $decimals = null,  $decimal_point = null,  $thousands_sep = null ) : void

Parameters
Name Type Description
$number
$decimals
$decimal_point
$thousands_sep
methodpublicgenerateChartStrings( string $xmlFile ) : \none

generates xml file for Flash charts to use for internationalized instances

Parameters
Name Type Description
$xmlFile string

location of the XML file to write to

Returns
Type Description
\none
methodpublicgenerateXML(  $xmlDataName = false ) : string

function to generate XML and return it

Parameters
Name Type Description
$xmlDataName

none

Returns
Type Description
string $xmlContents with xml information
methodpublicgetChartResources( ) : void

methodpublicgetDashletScript(  $id,  $xmlFile = "" ) : void

Parameters
Name Type Description
$id
$xmlFile
methodpublicgetData(  $query ) : void

Parameters
Name Type Description
$query
methodpublicgetMySugarChartResources( ) : void

methodpublicgetTotal( ) : void

methodpublicgetXMLFileName( string $file_id ) : void
static

returns a name for the XML File

Parameters
Name Type Description
$file_id string
  • unique id to make part of the file name
methodprivatenullGroup( \$sugarSetValue $superSetValue, \$url $url ) : void

nullGroup This function sets a null group by clause

Parameters
Name Type Description
$superSetValue \$sugarSetValue

Mixed value

$url \$url

String value of URL for the link

methodpublicprocessData( ) : string

returns xml data format

Returns
Type Description
string with xml data format
methodpublicprocessDataGroup(  $tablevel,  $title,  $value,  $label,  $link ) : void

Parameters
Name Type Description
$tablevel
$title
$value
$label
$link
methodpublicprocessGauge(  $position,  $target,  $phases = array() ) : void

Parameters
Name Type Description
$position
$target
$phases
methodpublicprocessXmlData( ) : void

methodpublicsaveXMLFile( string $xmlFilename,  $xmlContents ) : string

function to save XML contents into a file

Parameters
Name Type Description
$xmlFilename string

location of the xml file string $xmlContents contents of the xml file

$xmlContents
Returns
Type Description
string boolean denoting whether save has failed
methodpublicsetColors(  $colors = array() ) : void

Parameters
Name Type Description
$colors
methodpublicsetData(  $dataSet ) : void

Parameters
Name Type Description
$dataSet
methodpublicsetDisplayProperty(  $property,  $value ) : void

Parameters
Name Type Description
$property
$value
methodpublicsetProperties(  $title,  $subtitle,  $type,  $legend = 'on',  $labels = 'value',  $print = 'on',  $thousands = false ) : void

Parameters
Name Type Description
$title
$subtitle
$type
$legend
$labels
$print
$thousands
methodpublicsortData( 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.

If the data quantity is large, it maybe a little slow.

Parameters
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
Returns
Type Description
\The sorted and translated data.
methodpublictab( string $str,  $depth ) : string

returns text with tabs appended before it

Parameters
Name Type Description
$str string

input string int $depth number of times to tab

$depth
Returns
Type Description
string with tabs appended before it
methodpublictabValue(  $tag,  $value,  $depth ) : string

returns text with tabs appended before it

Parameters
Name Type Description
$tag
$value
$depth
Returns
Type Description
string with tabs appended before it
methodpublicxmlData( ) : void

methodpublicxmlDataBarChart( ) : void

methodpublicxmlDataForGaugeChart( ) : void

methodpublicxmlDataForGroupByChart( ) : void

methodpublicxmlDataGenericChart( ) : void

methodpublicxmlFooter( ) : string

returns the footer for the constructed xml file for sugarcharts

Returns
Type Description
string $footer XML footer
methodpublicxmlHeader( ) : string

returns the header for the constructed xml file for sugarcharts

Returns
Type Description
string $header XML header
methodpublicxmlProperties( ) : string

returns the properties tag for the constructed xml file for sugarcharts

Returns
Type Description
string $properties XML properties tag
methodpublicxmlYAxis( ) : string

returns the y-axis values for the chart

Returns
Type Description
string $yAxis XML yAxis tag
Documentation was generated by DocBlox 0.18.1.