LineChart API

LineChart methods for loading data, streaming samples, controlling the viewport, and updating appearance.

Import
import { LineChart } from "@sixtyfold/line";

Use the public entry point shown above.

ChartOverlayError

Error reported when one or more declarative overlay sources cannot be applied.

Import @sixtyfold/lineclass

class ChartOverlayError extends Error
MemberDefinitionDescription
cause?Error | undefinedCause for chart overlay error.
messagestringMessage text.
name"ChartOverlayError"Display name for this chart overlay error.
sourcesreadonly string[]Sources for chart overlay error.
stack?string | undefinedStack text.

ChartRendererError

Error reported when a chart renderer fails during startup or later use.

Import @sixtyfold/lineclass

class ChartRendererError extends Error
MemberDefinitionDescription
cause?Error | undefinedCause for chart renderer error.
messagestringMessage text.
name"ChartRendererError"Display name for this chart renderer error.
phaseRendererFailurePhasePhase for chart renderer error.
stack?string | undefinedStack text.

LineChart

Imperative browser chart for line, step, range, scatter, bar, and stacked-area series.

Import @sixtyfold/lineclass

class LineChart
MemberDefinitionDescription
addVector(timestamp: number, values: number[]) => voidAppends one timestamp and one value per series to the streaming buffer.
addVectors(timestamps: Float64Array, valuesBySeries: Float64Array[]) => voidAppends aligned timestamp and series columns to the streaming buffer.
batch(fn: () => void) => voidGroups synchronous appearance and viewport changes into one update. Nested batches are combined; data-loading calls still run immediately.
destroy() => voidReleases the chart and its owned resources.
getAppearance() => DeepReadonly<LineAppearanceOptions>Returns a read-only snapshot of the mutable appearance subset.
getOptions() => DeepReadonly<LineChartOptions>Returns a full normalized read-only snapshot of all options (construction + current appearance).
getRenderMode() => "worker" | "main"Returns the resolved rendering mode ("worker" or "main").
getSeriesVisibility() => boolean[]Returns series visibility.
getViewport() => ViewportReturns a snapshot of the current viewport.
initialize() => Promise<void>Wait until the renderer is ready for data and runtime commands. The construction-time initialization watchdog rejects this promise with a ChartRendererError when the worker or main-thread fallback does not become ready in the configured interval. Applications should await this method before installing their first dataset.
initStreaming(seriesCount: number, maxPoints?: number) => voidAllocates a fixed-capacity streaming buffer for the configured number of series.
reset(options?: { animated?: boolean; }) => voidReset the viewport to the full data extent.
resize() => voidSynchronizes the renderer with the canvas size.
setData(data: TimeSeriesData, options?: LineDataUpdateOptions) => numberLoads one series and gives the renderer ownership of its typed arrays. Worker mode transfers and detaches the buffers; main-thread mode retains the arrays by reference. Returns the data generation number. Throws: TypeError or RangeError when typed-array columns or declared lengths are malformed or misaligned.
setKeyboardAnnouncements(messages: false | KeyboardAnnouncementMessages) => voidReplace or disable the localized keyboard-action announcements at runtime. Existing pending announcements are cancelled.
setLabels(labels: ChartLabels) => voidUpdate chart labels at runtime. Merges into existing labels (same semantics as updateAppearance). Throws: TypeError for malformed labels or sparse/non-object custom entries.
setLODOptions(patch: LineLODOptions) => voidApply a partial update to mode, density, rebase ratio, or grid quantization without recreating the chart or rebuilding its hierarchy.
setMultiSeriesData(data: MultiSeriesData, options?: LineDataUpdateOptions) => numberLoads aligned series with one shared X column and gives the renderer ownership of their typed arrays. Worker mode transfers and detaches the buffers; main-thread mode retains the arrays by reference. Returns the data generation number. Throws: TypeError or RangeError when typed-array columns, series metadata, or declared lengths are malformed or misaligned.
setOverlay(overlay: OverlayOptions) => Promise<void>Update declarative overlay primitives at runtime. Valid primitives and successfully decoded images are installed even when another image fails. If every requested item fails, the previously rendered overlay remains installed. Resolution and renderer-delivery failures reject with ChartOverlayError; register setOverlayErrorCallback when the application also needs asynchronous notification. When called before the lazy renderer is ready, this promise includes the readiness wait. Superseded updates and chart destruction are routine cancellation and resolve without installing.
setOverlayErrorCallback(callback: OverlayErrorCallback | null) => voidRegister a callback for non-fatal overlay resolution or delivery failures. Successful overlay items are still installed. The matching setOverlay promise also rejects with the same error.
setRendererErrorCallback(callback: RendererErrorCallback | null) => voidRegister a one-shot renderer failure callback. Called once before teardown for initialization or runtime failures. Without a callback, errors use console.error. Pass null to cancel it; destroy calls do not invoke it.
setSeriesVisibilityCallback(callback: ((event: SeriesVisibilityChangeEvent) => void) | null) => voidReceives visibility changes made through the API or interactive legend.
setSeriesVisible(index: number, visible: boolean) => voidShows or hides one series by index.
setStatsCallback(callback: ((stats: LineChartStats) => void) | null, options?: LineChartStatsOptions) => voidEnables renderer statistics and receives throttled snapshots. Pass null to disable them.
setViewport(viewport: Partial<Viewport>, options?: { animated?: boolean; }) => voidSet the viewport range programmatically. Only xMin and/or xMax need to be provided; omitted fields keep current values.
setVisibleSeries(indices: number[]) => voidShows only the listed series indices.
toggleSeriesVisibility(index: number) => voidToggles series visibility.
updateAppearance(patch: DeepPartial<LineAppearanceOptions>) => voidPatch mutable appearance options at runtime. Throws: TypeError for malformed labels or sparse/non-object custom entries.
updateSeriesAppearance(index: number, patch: DeepPartial<SeriesAppearanceOptions>) => voidPatch visual config for a single series by index.