Logo
NeoArc Studio

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 TypeSelectorPurpose
chartapp-neoarc-chart-blockStandalone interactive chart with 7 chart types
chart-rowapp-neoarc-chart-row-blockResponsive row of multiple independent charts
split-content-chartapp-neoarc-split-content-chartRich text alongside a chart in configurable two-column layout

Chart Types

All three blocks support the same seven chart types.

Type IDDisplay NameAxesMulti-SeriesNotes
bar-verticalBarCategory (x) / Value (y)YesIndividual item colours for single series, series-level colours for multi
bar-horizontalHorizontal BarValue (x) / Category (y)YesGood for long labels, auto-height by item count in viewer
lineLineCategory (x) / Value (y)YesSmooth curves, no boundary gap
areaAreaCategory (x) / Value (y)YesSame as line but with 20% opacity fill beneath
stacked-barStacked BarCategory (x) / Value (y)RequiredAll series stacked, legend at bottom
donutPie / DonutNone (pie segments)No (uses first series)40%-70% radius ring, vertical legend on left
gaugeGaugeNone (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.

PaletteColours (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 TypePublished 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 SectionCharts Generated
Model OverviewGroup breakdown donut, archetype distribution bar, properties-per-entity bar (top 10)
Governance SummaryClassification distribution donut, encryption coverage gauge, audit coverage gauge

File Locations

ComponentPath
Shared typesneoarc-ui/src/app/controls/neoarc-chart-editor/chart-types.ts
Option builderneoarc-ui/src/app/controls/neoarc-chart-editor/chart-option-builder.ts
Palettesneoarc-ui/src/app/controls/neoarc-chart-editor/chart-palettes.ts
Shared editorneoarc-ui/src/app/controls/neoarc-chart-editor/neoarc-chart-editor.ts
Chart blockneoarc-ui/src/app/controls/neoarc-chart-block/neoarc-chart-block.ts
Chart row blockneoarc-ui/src/app/controls/neoarc-chart-row-block/neoarc-chart-row-block.ts
Split content chartneoarc-ui/src/app/controls/neoarc-split-content-chart/neoarc-split-content-chart.ts
Viewer componentneoarc-viewer/src/components/neoarc-chart-viewer.ts
Unit testsneoarc-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