You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://packagist.org/packages/saintsystems/nova-linkable-metrics)
@@ -103,12 +178,12 @@ You can define metric links using the `route` method from the `Linkable` trait i
103
178
$filter = base64_encode(json_encode([
104
179
[
105
180
'class' => UserStatus::class,
106
-
'value' => 'active',
181
+
'value' => '1',
107
182
],
108
183
]));
109
184
110
185
return [
111
-
(new TotalUsers)->width('1/3')->route('nova.pages.index', ['resource' => 'users', 'users_filter' => $filter]),
186
+
(new NewUsers)->width('1/3')->route('nova.pages.index', ['resource' => 'users', 'users_filter' => $filter]),
112
187
];
113
188
}
114
189
```
@@ -138,6 +213,48 @@ You can define metric links using the `route` method from the `Linkable` trait i
138
213
}
139
214
```
140
215
216
+
**Customizing Partition Links**
217
+
218
+
By default, Partition metrics can have links just like Value and Trend metrics. However, using the default `route` method like on Value and Trend metrics (as shown above) will simply link the PartitionMetric card title to the provided route/url.
219
+
220
+
For greater customization, you may pass a Closure to the new `link` method on the LinkablePartitionResult class that allows you to customize the link for each individual partition in the generated chart, and even pass partition information to the route like below:
221
+
222
+
```php
223
+
// App\Nova\Metrics\UsersByStatus
224
+
225
+
use SaintSystems\Nova\LinkableMetrics\LinkablePartition;
0 commit comments