PHP Class Piwik\Plugins\CoreVisualizations\Visualizations\Sparklines

The sparklines view currently only supports requesting columns from the same API (the API method of the defining report) via {Sparklines\Config::addSparklineMetric($columns = array('nb_visits', 'nb_unique_visitors'))}. Example: $view->config->addSparklineMetric('nb_visits'); // if an array of metrics given, they will be displayed comma separated $view->config->addTranslation('nb_visits', 'Visits'); Results in: [sparkline image] X visits Data is fetched from the configured $view->requestConfig->apiMethodToRequestDataTable. In case you want to add any custom sparklines from any other API method you can call {@link Sparklines\Config::addSparkline()}. Example: $sparklineUrlParams = array('columns' => array('nb_visits)); $evolution = array('currentValue' => 5, 'pastValue' => 10, 'tooltip' => 'Foo bar'); $view->config->addSparkline($sparklineUrlParams, $value = 5, $description = 'Visits', $evolution);
Inheritance: extends piwik\plugin\ViewDataTable
Show file Open project: piwik/piwik

Public Methods

Method Description
getDefaultConfig ( )
render ( ) : mixed

Private Methods

Method Description
applyFilters ( Piwik\DataTable\DataTableInterface $table )
fetchConfiguredSparklines ( )

Method Details

getDefaultConfig() public static method

public static getDefaultConfig ( )

render() public method

See also: ViewDataTable::main()
public render ( ) : mixed
return mixed