WebRADDocumentationExplore WebRAD ↗
WEBRAD / TECHNICAL REFERENCE

Charts

Responsive charts with up to five API series, typed point events, and an accessible data table.

WebChartsStandardVisual4 events

Quick start

Add Charts1 in the Designer. Use the example in a page method.

Charts1 · event
Charts1.chartsConfig = {
  ...Charts1.chartsConfig,
  type: 'bar',
  title: 'Monthly sales',
  valuePrefix: '$',
  decimalPlaces: 2,
};
Charts1.data = [{
  id: 'sales', name: 'Sales', color: '#58b9f5',
  points: [{ label: 'January', value: 1200 }, { label: 'February', value: 1800 }],
}];
Charts1.onPointClick = (_sender, event) => {
  Message(event.detail.label + ': ' + event.detail.value);
};

Configure a chart

  1. Add Charts from the palette. Double-click it or choose Configure Charts in the Inspector.
  2. Choose doughnut, pie, bar, horizontal bar, line, area, radar, or polar-area presentation.
  3. Set the title, subtitle, legend, grid, labels, stacking, and value formatting.
  4. In Appearance → Fonts & colors, choose the general/legend fonts, colors, and optional Lucide title icon.
  5. Configure up to five series. Each has its own name, color, API Client, endpoint, response list, label field, and numeric value field.
  6. Click Save chart to persist the configuration. Cancel or Escape discards the draft.

Prepare the endpoint's response schema in API Client first. List and field selectors follow that schema. Paths use JSON Pointer, such as /data for the list and /name or /total for fields relative to one item.

Load and inspect data

Execute the configured API operation from a page event. Charts observes that response and subsequent successful executions; each series may use a different client or endpoint. It also reads a successful response already available when the binding is attached.

Use data for transient series supplied by code, or chartsConfig for presentation. clear() removes displayed points; an active API binding can populate them again on its next successful response. Runtime assignments do not change the saved project.

Invalid or missing numeric measurements are omitted. Circular charts exclude negative measurements from the drawing and keep them in the data table. Cartesian charts support negative values. Empty responses display the configured empty message.

Point interaction

Link OnPointClick in Interaction. event.detail contains label, value, seriesId, seriesName, and index. The same activation supports mouse, touch, Enter, and Space. selectedLabel, selectedValue, and selectedSeriesId expose the last selection.

The Designer and editor use an identified sample. Preview and exports show actual data or the empty state. The chart and accessible data table resize with the component.

More examples

Observe an API operation
Observe an API operation
// Configure a series bound to ApiClient1 in the chart editor first.
const series = Charts1.chartsConfig.series[0];
if (!series) throw new Error('Configure a chart series first.');
const operation = ApiClient1.operations.find(item => item.id === series.operationId);
if (!operation) throw new Error('Configure the series API operation first.');
const unsubscribe = Charts1.bindApiClient(ApiClient1, operation.id, series.id);
try {
  await ApiClient1.execute(operation.name);
} finally {
  unsubscribe(); // This example observes one execution.
}
// Designer-configured series are bound and released automatically.

Inspector properties

Component options and defaults. Fields without runtime access are configured in the Inspector.

Property / sourceType and optionsDefaultRuntime access
nameName · Identitystring—name
xLeft · Size & positionnumber0x
yTop · Size & positionnumber0y
widthWidth · Size & positionnumber480width
heightHeight · Size & positionnumber320height
itemWidthResponsive width · Responsive sizeFit content grows the item to its widest rendered child and preserves child intrinsic widths; minimum and maximum width remain limits.enumfixed stretch fit-content"fixed"Inspector / configuration
itemHeightResponsive height · Responsive sizeFit content grows the item to its lowest rendered child and preserves child intrinsic heights; minimum and maximum height remain limits.enumfixed stretch fit-content"fixed"Inspector / configuration
itemMinWidthMinimum width · Responsive sizenumber0Inspector / configuration
itemMaxWidthMaximum width · Responsive sizenumbernullInspector / configuration
itemMinHeightMinimum height · Responsive sizenumber0Inspector / configuration
itemMaxHeightMaximum height · Responsive sizenumbernullInspector / configuration
itemGrowGrow · Responsive sizenumber0Inspector / configuration
itemShrinkShrink · Responsive sizeAllows fixed and stretch flow items to yield space. Fit-content keeps its intrinsic size so its children are not compressed.booleantrueInspector / configuration
itemAlignSelfItem alignment · Responsive sizeCross-axis alignment for this item in a row or column. Auto inherits the parent alignment; responsive cross-axis stretch retains its sizing behavior.enumauto start center end stretch"auto"Inspector / configuration
itemHorizontalAnchorHorizontal anchor · Anchors & offsetsenumstart center end stretch"start"Inspector / configuration
itemVerticalAnchorVertical anchor · Anchors & offsetsenumstart center end stretch"start"Inspector / configuration
itemLeftLeft inset · Anchors & offsetsnumber0Inspector / configuration
itemRightRight inset · Anchors & offsetsnumber0Inspector / configuration
itemTopTop inset · Anchors & offsetsnumber0Inspector / configuration
itemBottomBottom inset · Anchors & offsetsnumber0Inspector / configuration
marginMargin · SpacingOuter spacing on all four sides, in pixels. Row and column layouts include this spacing between components.number0margin
marginTopMargin top · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginTop
marginRightMargin right · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginRight
marginBottomMargin bottom · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginBottom
marginLeftMargin left · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginLeft
visibleVisible · Behaviorbooleantruevisible
collapseWhenHiddenCollapse when hidden · BehaviorRemoves the component from the layout while it is not visible.booleantruecollapseWhenHidden
enabledEnabled · Behaviorbooleantrueenabled
chartsConfigChart and data series · ChartsChoose a chart, customize its appearance and bind up to five API response series.charts-configEditor: charts-configurator{"schemaVersion":1,"type":"bar","title":"Chart title","subtitle":"","fontFamily":"inherit","legendFontFamily":"inherit","textColor":null,"titleColor":null,"subtitleColor":null,"legendColor":null,"titleIcon":null,"showLegend":true,"legendPosition":"bottom","showGrid":true,"showLabels":false,"smooth":true,"stacked":false,"innerRadius":65,"valuePrefix":"","valueSuffix":"","decimalPlaces":0,"emptyText":"No data to display","series":[]}chartsConfig
currentRowBindingsCurrent row · DataBind writable visual values to fields of this repeated row.current-row-bindingsEditor: current-row-bindings[]currentRowBindings

API in code

MemberSignatureAccess
chartsConfigPersisted chart appearance and up to five declarative API series.get chartsConfig(): WebChartsConfiguration;Read and write
dataCurrent transient series. Values remain numeric and never enter the Project Model.get data(): readonly WebChartSeriesData[];Read and write
selectedLabelget selectedLabel(): string | null;Read-only
selectedValueget selectedValue(): number | null;Read-only
selectedSeriesIdget selectedSeriesId(): string | null;Read-only
onPointClickset onPointClick(handler: WebChartPointEventHandler<this> | null);Read and write

clear

method
clear(): void;

Clears displayed points; an existing binding can refresh after the next successful request.

Example
Charts1.clear
Charts1.clear();

bindApiClient

method
bindApiClient(apiClient: WebApiClient, operationId: string, seriesId: string): () => void;

Binds one configured series to a named API operation by stable operation ID. Reads existing successful data and subsequent results; never executes a request.

Example
Charts1.bindApiClient
const series = Charts1.chartsConfig.series[0];
if (!series) throw new Error('Configure a series bound to ApiClient1 first.');
const unsubscribe = Charts1.bindApiClient(ApiClient1, series.operationId, series.id);
// Release a handwritten binding when it is no longer needed.
unsubscribe();

dispose

method
dispose(): void;
Example
Charts1.dispose
// Call only when disposing of an instance whose lifecycle you control.
Charts1.dispose();
Inherited members (26)
MemberSignatureAccess
currentRowBindingscurrentRowBindings: readonly WebCurrentRowBinding[];Read and write
elementreadonly element: TElement;Read-only
idreadonly id: string;Read-only
namereadonly name: string;Read-only
visiblevisible: boolean;Read and write
collapseWhenHiddencollapseWhenHidden: boolean;Read and write
enabledenabled: boolean;Read and write
xx: number;Read and write
yy: number;Read and write
widthwidth: number;Read and write
heightheight: number;Read and write
marginOuter spacing on all four sides, in pixels.margin: number;Read and write
marginTopmarginTop: number;Read and write
marginRightmarginRight: number;Read and write
marginBottommarginBottom: number;Read and write
marginLeftmarginLeft: number;Read and write
alignSelfalignSelf: RuntimeLayoutAlignSelf;Read and write
tabIndextabIndex: number;Read and write
backgroundColorbackgroundColor: string;Read and write
colorcolor: string;Read and write
borderColorborderColor: string;Read and write

focus

method
focus(options?: FocusOptions): void;

show

method
show(): void;

hide

method
hide(): void;

bindEvent

method
bindEvent(eventName: string, handler: WebComponentEventHandler<this> | null): () => void;

emit

method
emit(eventName: string, detail?: unknown): boolean;

Events

Link methods in Interaction. How to use events.

OnPointClick

WebChartPointEventDetail in event.detail · label, value, seriesId, seriesName, index

Runs when a chart point is clicked or activated with the keyboard.

Signature and example
Interaction → OnPointClick
import type { WebCharts, WebChartPointEventDetail } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Charts1PointClick(
    sender: WebCharts,
    event: CustomEvent<WebChartPointEventDetail>,
  ): Promise<void> {
    console.log(event.detail);
    const { label, value, seriesId, seriesName, index } = event.detail;
    console.log(label, value, seriesId, seriesName, index);
  }
}

OnClick

Standard event (Event).

Signature and example
Interaction → OnClick
import type { WebCharts } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Charts1Click(
    sender: WebCharts,
    event: Event,
  ): Promise<void> {
    console.log(sender.name, event.type);
  }
}

OnMouseEnter

Standard event (Event).

Signature and example
Interaction → OnMouseEnter
import type { WebCharts } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Charts1MouseEnter(
    sender: WebCharts,
    event: Event,
  ): Promise<void> {
    console.log(sender.name, event.type);
  }
}

OnMouseLeave

Standard event (Event).

Signature and example
Interaction → OnMouseLeave
import type { WebCharts } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Charts1MouseLeave(
    sender: WebCharts,
    event: Event,
  ): Promise<void> {
    console.log(sender.name, event.type);
  }
}
WebRAD · Atentor · Read in Markdown
Source code: 6a562bda75a0 (with local changes) · November 7, 2026

Search documentation

Type to search APIs, components, and events.