-
Notifications
You must be signed in to change notification settings - Fork 34
classes_lib_google_googlevisualization.class
Base class for google visualization controls.
Implements: ICallable
Extends: GoogleControl » Control » Renderable
Subclasses: gvAreaChart, gvBarChart, gvColumnChart, gvGauge, gvGeoChart, gvLineChart, gvOrgChart, gvPieChart, gvSteppedAreaChart, gvTable, gvWordTree
Manually adds a column specification to the visualization.
Definition: public function addColumn($name, $label=false, $type=false, $style=false)
Returns: static
Parameters:
-
string $nameColumn name -
string $labelColumn label -
string $typeType of values -
string $styleStyle of values
Adds a role to the last added column. A role consists of a name and a callback that will be polled for each column in each data row. The callback must return the value for the column role. Note that this is only implementend for role 'annotation'.
See https://developers.google.com/chart/interactive/docs/roles
Definition: public function addColumnRole($role, $callback=false)
Returns: static
Parameters:
-
string $roleRole specifier -
\Closure $callbackCallback function
Adds a data row. If you did not yet specify a header this row will be used as it. Calling this will set this into inline mdoe thus removing all database related settings (GoogleVisualization::setDbQuery).
Definition: public function addDataRow($args)
Returns: static
Parameters:
-
mixed $argsData values
Adds a callback method that will be called for each added data row.
Definition: public function addRowCallback($callback)
Returns: static
Parameters:
-
\Closure $callbackMethod to be called
Creates a google query entity from a database table. See https://developers.google.com/chart/interactive/docs/reference#queryobjects
Definition: public function EntityFromTable($table_name, $alias=false)
Returns: static
Parameters:
-
string $table_nameTable name -
string $aliasAlias name this can be referenced as
Interconnects two visualizations 'select' events.
Definition: public function linkSelect($other_vis)
Returns: static
Parameters:
-
GoogleVisualization $other_visThe other visualization
Static creator function.
Definition: public static function Make($args)
Returns: GoogleVisualization Created control
Parameters:
-
mixed $argsOnly one argument allowed: Title
Ensures a continous axis of type Date.
Definition: public function makeContinousDateAxis($format)
Returns: $this
Parameters:
-
string $formatOptional format
Ensures a continous axis of type Integer.
Definition: public function makeContinousIntAxis()
Returns: $this
Sets an option. Valid options vary for the different visualizations.
Definition: public function opt($name, $value=null)
Returns: static|null
Parameters:
-
string $nameOption name -
mixed $valueOPtion value
OVERRIDE GoogleControl::PreRender
INTERNAL AJAX callback for google queries. See https://developers.google.com/chart/interactive/docs/reference#queryobjects
Sets the data header. Calling this will set this into inline mode thus removing all database related settings (GoogleVisualization::setDbQuery).
Definition: public function setDataHeader($args)
Returns: static
Parameters:
-
mixed $argsHeader-values
Sets all data rows. If you did not yet specify a header first row will be used as it. Calling this will set this into inline mdoe thus removing all database related settings (GoogleVisualization::setDbQuery).
Definition: public function setDataRows($rows)
Returns: static
Parameters:
-
array $rowsTwo-dimensional array containing all the rows data
Sets the DataSource to be used
Definition: public function setDataSource($datasource)
Returns: static
Parameters:
-
mixed $datasourceOptional DataSource to use. This may also be the name of the DataSource to use asstring.
Sets up a google query from a database table. See https://developers.google.com/chart/interactive/docs/reference#queryobjects Calling this will set the GoogleVisualization in database mode thus clearing all inline data set with GoogleVisualization::setDataHeader and GoogleVisualization::addDataRow
Definition: public function setDbQuery($table_name, $query, $datasource=false)
Returns: static
Parameters:
-
string $table_nameTable name -
mixed $queryThe goolge query -
DataSource $datasourceOptional DataSource to use. This may also be the name of the DataSource to use asstring.
Sets up a ResultSet as source of multiple data series.
Definition: public function setMultiSeriesResultSet($rs, $xAxisCol, $newColSpecifier, $newColValue, $newcolformat)
Returns: $this
Parameters:
-
\ScavixWDF\Model\ResultSet $rsThe resultset containing the series data -
string $xAxisColName of column containing the xAxis data -
string $newColSpecifierName of column containing the series identifiers -
string $newColValueName of column containing the real series data -
string $newcolformatOptional format of the data values
Adds a ResultSet as data for this visualization. The set may contain any column but it must contain all columns defined thru GoogleVisualization::addColumn or GoogleVisualization::addColumnRole.
Definition: public function setResultSet($rs)
Returns: static
Parameters:
-
\ScavixWDF\Model\ResultSet $rsResultSet with data.
SHORTCUT GoogleVisualization::opt('width',$width)->GoogleVisualization::opt('height',$height)
Sets up an SQL query (optionally with arguments) as data for this visualization.
Definition: public function setSqlQuery($sql, $args, $datasource=false)
Returns: static
Parameters:
-
string $sqlThe SQL statement -
array $argsOptional arguments -
mixed $datasourceOptional DataSource to be used
SHORTCUT GoogleVisualization::opt('title',$title);
Definition: public function __construct($type=false, $options, $query=false, $ds=false)
Returns: NOT DOCUMENTED
Parameters:
-
string $typeType of google visualization -
array $optionsOptions. Depends on $type -
string $queryA valid google query string. See queryobjects -
DataSource $dsDataSource to use, will fall back to GoogleVisualization::$DefaultDatasource or (if that is not set) to model_datasource('internal')