Skip to content

Commit

Permalink
refs matomo-org#3994 do not create a separate class for this example
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteur committed Oct 21, 2013
1 parent d1abe71 commit 6a3d27b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 43 deletions.
19 changes: 14 additions & 5 deletions plugins/ExampleUI/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,21 @@ public function dataTables()
$controllerAction = $this->pluginName . '.' . __FUNCTION__;
$apiAction = 'ExampleUI.getTemperatures';

/**
* this is an example how you can make a custom visualization reusable.
*/
$table = new CustomDataTable();
$view = Factory::build('table', $apiAction, $controllerAction);

echo $table->render('Temperature in °C', 'Hour of day', $apiAction, $controllerAction);
$view->config->translations['value'] = 'Temperature in °C';
$view->config->translations['label'] = 'Hour of day';
$view->requestConfig->filter_sort_column = 'label';
$view->requestConfig->filter_sort_order = 'asc';
$view->requestConfig->filter_limit = 24;
$view->config->columns_to_display = array('label', 'value');
$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;

echo $view->render();
}

public function evolutionGraph()
Expand Down
38 changes: 0 additions & 38 deletions plugins/ExampleUI/CustomDataTable.php

This file was deleted.

0 comments on commit 6a3d27b

Please sign in to comment.