File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ The `stats::time-series` component accepts the following attributes:
108108- ** ` filters ` ** : Associative array of filter values.
109109- ** ` api-url ` ** : The API url to call for generating the stats graph. Defaults to the route defined by ` TimeSeriesStats::registerApiRoute ` .
110110- ** ` user ` ** : The user who you want to display the stats for. Defaults to the current user.
111+ - ** ` metrics ` ** : Key-Value array of metrics to show. Defaults to the metrics visible to the given user for the given filters.
111112- ** ` framework ` ** : Which CSS framework to use. Defaults to framework defined in the package config.
112113
113114# Add links
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ public function __construct(
2626 string $ url = '' ,
2727 string $ apiUrl = '' ,
2828 array $ filters = [],
29+ array $ metrics = [],
2930 ?Authorizable $ user = null ,
3031 string $ framework = ''
3132 ) {
@@ -35,6 +36,6 @@ public function __construct(
3536 $ this ->user = $ user ?: auth ()->user ();
3637 $ this ->url = $ url ?: action ([TimeSeriesStatsController::class, 'export ' ]);
3738 $ this ->apiUrl = $ apiUrl ?: action ([TimeSeriesStatsApiController::class, 'index ' ]);
38- $ this ->metrics = TimeSeriesStats::getMetricNames ($ this ->filters , $ this ->user );
39+ $ this ->metrics = $ metrics ?: TimeSeriesStats::getMetricNames ($ this ->filters , $ this ->user );
3940 }
4041}
You can’t perform that action at this time.
0 commit comments