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
Copy file name to clipboardExpand all lines: adminforth/documentation/docs/tutorial/08-Plugins/27-dashboard.md
+42-4Lines changed: 42 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -212,7 +212,45 @@ query:
212
212
direction: desc
213
213
```
214
214
215
-
Funnel charts use a steps query because each step can use its own resource, metric, and filters.
215
+
Step-based charts use a `steps` query when each step needs its own resource, metric, and filters. Funnel charts always use this query shape.
216
+
217
+
Depending on the widget, `query` can also use `limit`, `offset`, `calcs`, `time_series`, `period`, `bucket`, and `formatting`.
218
+
219
+
Widget-scoped constants can be defined with `variables`. They are available inside `query.calcs` through `lookup($variables.path, field, default)`.
220
+
221
+
```yaml
222
+
label: Average Car Price by Database
223
+
target: chart
224
+
variables:
225
+
price_multipliers:
226
+
cars_sl: 0.84
227
+
cars_mysql: 1.12
228
+
chart:
229
+
type: bar
230
+
x:
231
+
field: name
232
+
y:
233
+
field: adjusted_value
234
+
query:
235
+
steps:
236
+
- name: SQLite
237
+
resource: cars_sl
238
+
metric:
239
+
agg: avg
240
+
field: price
241
+
as: value
242
+
- name: MySQL
243
+
resource: cars_mysql
244
+
metric:
245
+
agg: avg
246
+
field: price
247
+
as: value
248
+
calcs:
249
+
- calc: value * lookup($variables.price_multipliers, resource, 1)
250
+
as: adjusted_value
251
+
```
252
+
253
+
Define `variables` on each widget config. Dashboard root variables are not merged into widget data queries.
216
254
217
255
## Widget Examples
218
256
@@ -406,11 +444,11 @@ Widgets support these layout fields:
406
444
size: small
407
445
width: 320
408
446
height: 360
409
-
minWidth: 240
410
-
maxWidth: 640
447
+
min_width: 240
448
+
max_width: 640
411
449
```
412
450
413
-
`size`can be `small`, `medium`, `large`, `wide`, or `full`. Explicit `width`, `height`, `minWidth`, and `maxWidth` can be used when a widget needs more precise sizing.
451
+
`size`can be `small`, `medium`, `large`, `wide`, or `full`. Explicit `width`, `height`, `min_width`, and `max_width` can be used when a widget needs more precise sizing.
0 commit comments