Chart Blocks Reference
Complete reference for the three ECharts-powered chart content blocks: Chart, Chart Row, and Text + Chart. Includes all properties, chart types, colour palettes, and data format specifications.
Three content block types provide chart rendering capabilities, all powered by ECharts with SVG output. They share a common chart editor component and option builder, ensuring consistent behaviour across standalone charts, dashboard rows, and text-alongside-chart layouts.
Block Summary
| Block Type | Selector | Purpose |
|---|---|---|
| chart | app-neoarc-chart-block | Standalone interactive chart with 7 chart types |
| chart-row | app-neoarc-chart-row-block | Responsive row of multiple independent charts |
| split-content-chart | app-neoarc-split-content-chart | Rich text alongside a chart in configurable two-column layout |
Chart Types
All three blocks support the same seven chart types.
| Type ID | Display Name | Axes | Multi-Series | Notes |
|---|---|---|---|---|
| bar-vertical | Bar | Category (x) / Value (y) | Yes | Individual item colours for single series, series-level colours for multi |
| bar-horizontal | Horizontal Bar | Value (x) / Category (y) | Yes | Good for long labels, auto-height by item count in viewer |
| line | Line | Category (x) / Value (y) | Yes | Smooth curves, no boundary gap |
| area | Area | Category (x) / Value (y) | Yes | Same as line but with 20% opacity fill beneath |
| stacked-bar | Stacked Bar | Category (x) / Value (y) | Required | All series stacked, legend at bottom |
| donut | Pie / Donut | None (pie segments) | No (uses first series) | 40%-70% radius ring, vertical legend on left |
| gauge | Gauge | None (single value) | No (uses first value) | 200 to -20 degree arc, auto-colour by threshold: green >=80, amber >=50, red <50 |
ChartBlockData Interface
The core data model shared by all three block types.
interface ChartBlockData {
chartType: 'bar-horizontal' | 'bar-vertical' | 'stacked-bar'
| 'donut' | 'gauge' | 'line' | 'area';
title?: string;
subtitle?: string;
height?: number; // pixels, default 350
series: ChartSeries[]; // one or more data series
labels?: string[]; // category labels
showLegend?: boolean; // default true
showValues?: boolean; // default false
colorPalette?: ChartPalette;
customColors?: string[]; // hex array, only when palette = 'custom'
xAxisLabel?: string;
yAxisLabel?: string;
}
interface ChartSeries {
name: string;
values: number[];
}
type ChartPalette = 'default' | 'warm' | 'cool' | 'monochrome' | 'custom';
ChartRowBlockData Interface
interface ChartRowBlockData {
charts: ChartRowItem[]; // array of chart items
gap?: number; // pixels between charts, default 16
equalHeight?: boolean; // force uniform height, default true
height?: number; // row height in px, default 300
}
interface ChartRowItem {
id: string; // unique identifier
minWidth?: number; // min width before wrap, default 300
chart: ChartBlockData; // independent chart config
}
SplitContentChartBlockData Interface
interface SplitContentChartBlockData {
layout: 'text-left' | 'text-right';
textContent: string; // HTML rich text
chart: ChartBlockData; // chart configuration
splitRatio?: '50-50' | '40-60' | '60-40'
| '33-67' | '67-33'; // default '50-50'
verticalAlign?: 'top' | 'center' | 'bottom';
}
Colour Palettes
Each palette contains 10 colours, cycled for charts with more than 10 categories.
| Palette | Colours (first 5) |
|---|---|
| default | #6366f1 (indigo), #22c55e (green), #f59e0b (amber), #ef4444 (red), #06b6d4 (cyan) |
| warm | #f59e0b (amber), #f97316 (orange), #ef4444 (red), #ec4899 (pink), #e11d48 (rose) |
| cool | #3b82f6 (blue), #06b6d4 (cyan), #14b8a6 (teal), #22c55e (green), #6366f1 (indigo) |
| monochrome | #6366f1, #818cf8, #a5b4fc, #4f46e5, #c7d2fe (indigo lightness scale) |
Publishing Pipeline
During publishing, the pipeline converts ChartBlockData into pre-built EChartsOption objects using the pure function buildEChartsOption(). The viewer receives ready-to-render option objects and passes them directly to the neoarc-chart-viewer Lit component.
| Block Type | Published Format |
|---|---|
| chart | { options: EChartsOption, chartTitle: string, height: number } |
| chart-row | { charts: [{ options, chartTitle, minWidth }], gap, equalHeight, height } |
| split-content-chart | { layout, textContent, chartOptions: EChartsOption, chartTitle, chartHeight, splitRatio, verticalAlign } |
Narrative Engine Integration
The narrative engine generates chart blocks automatically in two report sections.
| Report Section | Charts Generated |
|---|---|
| Model Overview | Group breakdown donut, archetype distribution bar, properties-per-entity bar (top 10) |
| Governance Summary | Classification distribution donut, encryption coverage gauge, audit coverage gauge |
File Locations
| Component | Path |
|---|---|
| Shared types | neoarc-ui/src/app/controls/neoarc-chart-editor/chart-types.ts |
| Option builder | neoarc-ui/src/app/controls/neoarc-chart-editor/chart-option-builder.ts |
| Palettes | neoarc-ui/src/app/controls/neoarc-chart-editor/chart-palettes.ts |
| Shared editor | neoarc-ui/src/app/controls/neoarc-chart-editor/neoarc-chart-editor.ts |
| Chart block | neoarc-ui/src/app/controls/neoarc-chart-block/neoarc-chart-block.ts |
| Chart row block | neoarc-ui/src/app/controls/neoarc-chart-row-block/neoarc-chart-row-block.ts |
| Split content chart | neoarc-ui/src/app/controls/neoarc-split-content-chart/neoarc-split-content-chart.ts |
| Viewer component | neoarc-viewer/src/components/neoarc-chart-viewer.ts |
| Unit tests | neoarc-ui/src/app/controls/neoarc-chart-editor/chart-option-builder.spec.ts |
Learn More
- Guide: Chart Block - chart types, palettes, and examples
- Guide: Chart Row Block - dashboard layouts and responsive behaviour
- Guide: Text + Chart Block - narrative documentation with data visualisation