\Kendo\Dataviz\UI\TreeMap
A PHP wrapper for Kendo UI TreeMap.
Inherits from \Kendo\UI\Widget.
Usage
To use TreeMap in a PHP page instantiate a new instance, configure it via the available
configuration methods and output it by echo
-ing the result of the render method.
Using Kendo TreeMap
<?php
// Create a new instance of TreeMap and specify its id
$treeMap = new \Kendo\Dataviz\UI\TreeMap('TreeMap');
// Configure it
$treeMap->autoBind(true)
// Output it
echo $treeMap->render();
?>
Methods
autoBind
If set to false the widget will not bind to the data source during initialization. In this case data binding will occur when the change event of the data source is fired. By default the widget will bind to the data source specified in the configuration.
Returns
\Kendo\Dataviz\UI\TreeMap
Parameters
$value boolean
Example
<?php
$treeMap = new \Kendo\Dataviz\UI\TreeMap('TreeMap');
$treeMap->autoBind(true);
?>
colorField
The data item field which contains the tile color.
Returns
\Kendo\Dataviz\UI\TreeMap
Parameters
$value string
Example
<?php
$treeMap = new \Kendo\Dataviz\UI\TreeMap('TreeMap');
$treeMap->colorField('value');
?>
colors
The default colors for the TreeMap items (tiles). Can be set to array of specific colors or array of color ranges. For more information on the widget behavior, see the Colors section on the TreeMap Overview page.
Returns
\Kendo\Dataviz\UI\TreeMap
Parameters
$value array
Example
<?php
$treeMap = new \Kendo\Dataviz\UI\TreeMap('TreeMap');
$treeMap->colors(array());
?>
dataBound
Fired when the widget is bound to data from its dataSource. For additional information check the dataBound event documentation.
Returns
\Kendo\Dataviz\UI\TreeMap
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$treeMap = new \Kendo\Dataviz\UI\TreeMap('TreeMap');
$treeMap->dataBound('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onDataBound(e) {
// handle the dataBound event.
}
</script>
<?php
$treeMap = new \Kendo\Dataviz\UI\TreeMap('TreeMap');
$treeMap->dataBound('onDataBound');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$treeMap = new \Kendo\Dataviz\UI\TreeMap('TreeMap');
$treeMap->dataBound(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
dataSource
Sets the data source of the widget.
Returns
\Kendo\Dataviz\UI\TreeMap
Parameters
$value \Kendo\Data\DataSource|array
Example - using \Kendo\Data\DataSource
<?php
$treeMap = new \Kendo\Dataviz\UI\TreeMap('TreeMap');
$dataSource = new \Kendo\Data\DataSource();
$treeMap->dataSource($dataSource);
?>
Example - using array
<?php
$treeMap = new \Kendo\Dataviz\UI\TreeMap('TreeMap');
$schema = new \Kendo\Data\DataSourceSchema();
$treeMap->dataSource(array('schema' => $schema));
?>
itemCreated
Fired when a tile has been created. For additional information check the itemCreated event documentation.
Returns
\Kendo\Dataviz\UI\TreeMap
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$treeMap = new \Kendo\Dataviz\UI\TreeMap('TreeMap');
$treeMap->itemCreated('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onItemCreated(e) {
// handle the itemCreated event.
}
</script>
<?php
$treeMap = new \Kendo\Dataviz\UI\TreeMap('TreeMap');
$treeMap->itemCreated('onItemCreated');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$treeMap = new \Kendo\Dataviz\UI\TreeMap('TreeMap');
$treeMap->itemCreated(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
template
The template which renders the treeMap tile content.The fields which can be used in the template are: dataItem - the original data item used to construct the point. or text - the original tile text..
Returns
\Kendo\Dataviz\UI\TreeMap
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string
<?php
$treeMap = new \Kendo\Dataviz\UI\TreeMap('TreeMap');
$treeMap->template('value');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$treeMap = new \Kendo\Dataviz\UI\TreeMap('TreeMap');
$treeMap->template(new \Kendo\JavaScriptFunction('function() { }'));
?>
textField
The data item field which contains the tile title.
Returns
\Kendo\Dataviz\UI\TreeMap
Parameters
$value string
Example
<?php
$treeMap = new \Kendo\Dataviz\UI\TreeMap('TreeMap');
$treeMap->textField('value');
?>
theme
The theme of the TreeMap.Note: Since Q2 2024 release, the default value for the theme property is "sass" instead of "default". It is recommended to use "sass" with version Q2 2024 or later.
Returns
\Kendo\Dataviz\UI\TreeMap
Parameters
$value string
Example
<?php
$treeMap = new \Kendo\Dataviz\UI\TreeMap('TreeMap');
$treeMap->theme('value');
?>
type
The layout type for the Treemap.
Returns
\Kendo\Dataviz\UI\TreeMap
Parameters
$value string
Example
<?php
$treeMap = new \Kendo\Dataviz\UI\TreeMap('TreeMap');
$treeMap->type('value');
?>
valueField
The data item field which contains the tile value.
Returns
\Kendo\Dataviz\UI\TreeMap
Parameters
$value string
Example
<?php
$treeMap = new \Kendo\Dataviz\UI\TreeMap('TreeMap');
$treeMap->valueField('value');
?>