diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2013-10-15 08:02:39 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2013-10-15 08:02:39 +0400 |
commit | 7ab8ddea529db95646f868bb8bb920ab70819876 (patch) | |
tree | acdab7a8ff69c3cfa22c0f6502267c6208f3f1d0 /plugins/ExampleUI | |
parent | c23052df08493a0ecba22d1224d773073102e3ea (diff) |
removed visualization properties
Diffstat (limited to 'plugins/ExampleUI')
-rw-r--r-- | plugins/ExampleUI/Controller.php | 38 | ||||
-rw-r--r-- | plugins/ExampleUI/CustomDataTable.php | 28 |
2 files changed, 27 insertions, 39 deletions
diff --git a/plugins/ExampleUI/Controller.php b/plugins/ExampleUI/Controller.php index f4dd86c6fb..d8194f2fc9 100644 --- a/plugins/ExampleUI/Controller.php +++ b/plugins/ExampleUI/Controller.php @@ -62,11 +62,11 @@ class Controller extends \Piwik\Plugin\Controller $view = ViewDataTable::factory( 'graphVerticalBar', 'ExampleUI.getTemperatures', $controllerAction = 'ExampleUI.barGraph'); - $view->y_axis_unit = '°C'; - $view->show_footer = false; - $view->translations['value'] = "Temperature"; - $view->visualization_properties->selectable_columns = array("value"); - $view->visualization_properties->max_graph_elements = 24; + $view->config->y_axis_unit = '°C'; + $view->config->show_footer = false; + $view->config->translations['value'] = "Temperature"; + $view->config->selectable_columns = array("value"); + $view->config->max_graph_elements = 24; echo $view->render(); } @@ -76,11 +76,11 @@ class Controller extends \Piwik\Plugin\Controller $view = ViewDataTable::factory( 'graphPie', 'ExampleUI.getPlanetRatios', $controllerAction = 'ExampleUI.pieGraph'); - $view->columns_to_display = array('value'); - $view->translations['value'] = "times the diameter of Earth"; - $view->show_footer_icons = false; - $view->visualization_properties->selectable_columns = array("value"); - $view->visualization_properties->max_graph_elements = 10; + $view->config->columns_to_display = array('value'); + $view->config->translations['value'] = "times the diameter of Earth"; + $view->config->show_footer_icons = false; + $view->config->selectable_columns = array("value"); + $view->config->max_graph_elements = 10; echo $view->render(); } @@ -103,9 +103,9 @@ class Controller extends \Piwik\Plugin\Controller $view = ViewDataTable::factory( 'cloud', 'ExampleUI.getPlanetRatios', $controllerAction = 'ExampleUI.echoSimpleTagClouds'); - $view->columns_to_display = array('label', 'value'); - $view->translations['value'] = "times the diameter of Earth"; - $view->show_footer = false; + $view->config->columns_to_display = array('label', 'value'); + $view->config->translations['value'] = "times the diameter of Earth"; + $view->config->show_footer = false; echo $view->render(); } @@ -115,13 +115,9 @@ class Controller extends \Piwik\Plugin\Controller $view = ViewDataTable::factory( 'cloud', 'ExampleUI.getPlanetRatiosWithLogos', $controllerAction = 'ExampleUI.echoAdvancedTagClouds'); - $view->visualization_properties->setForVisualization( - 'Piwik\\Plugins\\CoreVisualizations\\Visualizations\\Cloud', - 'display_logo_instead_of_label', - true - ); - $view->columns_to_display = array('label', 'value'); - $view->translations['value'] = "times the diameter of Earth"; + $view->config->display_logo_instead_of_label = true; + $view->config->columns_to_display = array('label', 'value'); + $view->config->translations['value'] = "times the diameter of Earth"; echo $view->render(); } @@ -142,7 +138,7 @@ class Controller extends \Piwik\Plugin\Controller $serverRequested = Common::getRequestVar('server', false); if (false !== $serverRequested) { - $view->columns_to_display = array($serverRequested); + $view->config->columns_to_display = array($serverRequested); } echo $view->render(); diff --git a/plugins/ExampleUI/CustomDataTable.php b/plugins/ExampleUI/CustomDataTable.php index bfda92a704..f0bfb4ca07 100644 --- a/plugins/ExampleUI/CustomDataTable.php +++ b/plugins/ExampleUI/CustomDataTable.php @@ -20,24 +20,16 @@ class CustomDataTable { $view = ViewDataTable::factory('table', $apiAction, $controllerAction); - $view->translations['value'] = $value; - $view->translations['label'] = $label; - $view->filter_sort_column = 'label'; - $view->filter_sort_order = 'asc'; - $view->filter_limit = 24; - $view->y_axis_unit = '°C'; // useful if the user requests the bar graph - $view->show_exclude_low_population = false; - $view->show_table_all_columns = false; - $view->visualization_properties->setForVisualization( - 'Piwik\\Plugins\\CoreVisualizations\\Visualizations\\HtmlTable', - 'disable_row_evolution', - true - ); - $view->visualization_properties->setForVisualization( - 'Piwik\\Plugins\\CoreVisualizations\\Visualizations\\JqplotGraph', - 'max_graph_elements', - 24 - ); + $view->config->translations['value'] = $value; + $view->config->translations['label'] = $label; + $view->requestConfig->filter_sort_column = 'label'; + $view->requestConfig->filter_sort_order = 'asc'; + $view->requestConfig->filter_limit = 24; + $view->config->y_axis_unit = '°C'; // useful if the user requests the bar graph + $view->config->show_exclude_low_population = false; + $view->config->show_table_all_columns = false; + $view->config->disable_row_evolution = true; + $view->config->max_graph_elements = 24; return $view->render(); } |