diff options
author | diosmosis <benakamoorthi@fastmail.fm> | 2013-12-09 23:20:11 +0400 |
---|---|---|
committer | diosmosis <benakamoorthi@fastmail.fm> | 2013-12-09 23:20:11 +0400 |
commit | 53005c87136f00ff2c353f6a3b4458c1dd7a9c3f (patch) | |
tree | 7efa7e2f0fc0113b8f27c6970b038115aaa80895 /plugins/ExampleUI | |
parent | 4080ffb4b7a835d1d65c88a96886bbbda1edd600 (diff) |
Add treemap example to ExampleUI plugin.
Diffstat (limited to 'plugins/ExampleUI')
-rw-r--r-- | plugins/ExampleUI/Controller.php | 13 | ||||
-rw-r--r-- | plugins/ExampleUI/ExampleUI.php | 4 |
2 files changed, 17 insertions, 0 deletions
diff --git a/plugins/ExampleUI/Controller.php b/plugins/ExampleUI/Controller.php index 8279334292..c6f94b5aea 100644 --- a/plugins/ExampleUI/Controller.php +++ b/plugins/ExampleUI/Controller.php @@ -183,4 +183,17 @@ class Controller extends \Piwik\Plugin\Controller return $view->render(); } + + public function treemap() + { + $view = ViewDataTableFactory::build( + 'infoviz-treemap', 'ExampleUI.getTemperatures', $controllerAction = 'ExampleUI.treemap'); + + $view->config->translations['value'] = "Temperature"; + $view->config->columns_to_display = array("value"); + $view->config->selectable_columns = array("value"); + $view->config->show_evolution_values = 0; + + return $view->render(); + } } diff --git a/plugins/ExampleUI/ExampleUI.php b/plugins/ExampleUI/ExampleUI.php index 79b79d7d81..11b567c00e 100644 --- a/plugins/ExampleUI/ExampleUI.php +++ b/plugins/ExampleUI/ExampleUI.php @@ -39,6 +39,10 @@ class ExampleUI extends \Piwik\Plugin $this->addSubMenu('Tag clouds', 'tagClouds', 4); $this->addSubMenu('Sparklines', 'sparklines', 5); $this->addSubMenu('Evolution Graph', 'evolutionGraph', 6); + + if (class_exists("Piwik\\Plugins\\TreemapVisualization\\Treemap")) { + $this->addSubMenu('Treemap', 'treemap', 7); + } } function addTopMenuItems() |