AML VizBlock
VizBlock wraps a visualization (chart, table, KPI) with a label and optional styling. The viz parameter specifies the chart type and its configuration.
Syntax
block <name>: VizBlock {
label: 'Block Title'
viz: <ChartType> {
dataset: <dataset_name>
// chart-specific parameters
}
theme: BlockTheme { ... } // optional
}
Parameters
| Parameter | Description |
|---|---|
label | Display name shown as the block title. |
viz | The visualization object. See chart types below. |
theme | Optional BlockTheme override for visual styling. |
Chart types
The viz parameter accepts any of the following chart types:
| Chart type | Description |
|---|---|
BarChart | Vertical or horizontal bar chart |
LineChart | Line chart |
AreaChart | Area chart |
CombinationChart | Mixed bar + line chart |
PieChart | Pie or donut chart |
ScatterChart | Scatter plot |
BubbleChart | Bubble chart |
Funnel | Funnel chart |
Gauge | Gauge chart |
Radar | Radar/spider chart |
Pyramid | Pyramid chart |
WordCloud | Word cloud |
SingleValue | Single metric or KPI card |
DataTable | Data table |
PivotTable | Pivot table |
MetricSheet | Metric sheet |
Example
block revenue_chart: VizBlock {
label: 'Revenue Over Time'
viz: CombinationChart {
dataset: ecommerce
settings {
row_limit: 5000
legend_label: 'top'
}
}
}
block order_count: VizBlock {
label: 'Total Orders'
viz: SingleValue {
dataset: ecommerce
series {
field {
ref: r(orders.id)
aggregation: 'count'
}
}
}
}
For per-chart-type parameters, the AML editor shows accepted values on hover. You can also apply a VizTheme inside the viz object to override table styling.
See also
- AML Dashboard: full dashboard syntax
- AML Theme:
BlockThemeandVizThemereference