Skip to main content

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

ParameterDescription
labelDisplay name shown as the block title.
vizThe visualization object. See chart types below.
themeOptional BlockTheme override for visual styling.

Chart types

The viz parameter accepts any of the following chart types:

Chart typeDescription
BarChartVertical or horizontal bar chart
LineChartLine chart
AreaChartArea chart
CombinationChartMixed bar + line chart
PieChartPie or donut chart
ScatterChartScatter plot
BubbleChartBubble chart
FunnelFunnel chart
GaugeGauge chart
RadarRadar/spider chart
PyramidPyramid chart
WordCloudWord cloud
SingleValueSingle metric or KPI card
DataTableData table
PivotTablePivot table
MetricSheetMetric 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


Open Markdown
Let us know what you think about this document :)