LineChart API
LineChart methods for loading data, streaming samples, controlling the viewport, and updating appearance.
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/line·class
class ChartOverlayError extends Error| Member | Definition | Description |
|---|---|---|
cause? | Error | undefined | Cause for chart overlay error. |
message | string | Message text. |
name | "ChartOverlayError" | Display name for this chart overlay error. |
sources | readonly string[] | Sources for chart overlay error. |
stack? | string | undefined | Stack text. |
ChartRendererError
Error reported when a chart renderer fails during startup or later use.
Import @sixtyfold/line·class
class ChartRendererError extends Error| Member | Definition | Description |
|---|---|---|
cause? | Error | undefined | Cause for chart renderer error. |
message | string | Message text. |
name | "ChartRendererError" | Display name for this chart renderer error. |
phase | RendererFailurePhase | Phase for chart renderer error. |
stack? | string | undefined | Stack text. |
LineChart
Imperative browser chart for line, step, range, scatter, bar, and stacked-area series.
Import @sixtyfold/line·class
class LineChart| Member | Definition | Description |
|---|---|---|
add | (timestamp: number, values: number[]) => void | Appends one timestamp and one value per series to the streaming buffer. |
add | (timestamps: Float64Array, valuesBySeries: Float64Array[]) => void | Appends aligned timestamp and series columns to the streaming buffer. |
batch | (fn: () => void) => void | Groups synchronous appearance and viewport changes into one update. Nested batches are combined; data-loading calls still run immediately. |
destroy | () => void | Releases the chart and its owned resources. |
get | () => DeepReadonly<LineAppearanceOptions> | Returns a read-only snapshot of the mutable appearance subset. |
get | () => DeepReadonly<LineChartOptions> | Returns a full normalized read-only snapshot of all options (construction + current appearance). |
get | () => "worker" | "main" | Returns the resolved rendering mode ("worker" or "main"). |
get | () => boolean[] | Returns series visibility. |
get | () => Viewport | Returns 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. |
init | (seriesCount: number, maxPoints?: number) => void | Allocates a fixed-capacity streaming buffer for the configured number of series. |
reset | (options?: { animated?: boolean; }) => void | Reset the viewport to the full data extent. |
resize | () => void | Synchronizes the renderer with the canvas size. |
set | (data: TimeSeriesData, options?: LineDataUpdateOptions) => number | Loads 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. |
set | (messages: false | KeyboardAnnouncementMessages) => void | Replace or disable the localized keyboard-action announcements at runtime. Existing pending announcements are cancelled. |
set | (labels: ChartLabels) => void | Update chart labels at runtime. Merges into existing labels (same semantics as updateAppearance). Throws: TypeError for malformed labels or sparse/non-object custom entries. |
set | (patch: LineLODOptions) => void | Apply a partial update to mode, density, rebase ratio, or grid quantization without recreating the chart or rebuilding its hierarchy. |
set | (data: MultiSeriesData, options?: LineDataUpdateOptions) => number | Loads 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. |
set | (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. |
set | (callback: OverlayErrorCallback | null) => void | Register 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. |
set | (callback: RendererErrorCallback | null) => void | Register 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. |
set | (callback: ((event: SeriesVisibilityChangeEvent) => void) | null) => void | Receives visibility changes made through the API or interactive legend. |
set | (index: number, visible: boolean) => void | Shows or hides one series by index. |
set | (callback: ((stats: LineChartStats) => void) | null, options?: LineChartStatsOptions) => void | Enables renderer statistics and receives throttled snapshots. Pass null to disable them. |
set | (viewport: Partial<Viewport>, options?: { animated?: boolean; }) => void | Set the viewport range programmatically. Only xMin and/or xMax need to be provided; omitted fields keep current values. |
set | (indices: number[]) => void | Shows only the listed series indices. |
toggle | (index: number) => void | Toggles series visibility. |
update | (patch: DeepPartial<LineAppearanceOptions>) => void | Patch mutable appearance options at runtime. Throws: TypeError for malformed labels or sparse/non-object custom entries. |
update | (index: number, patch: DeepPartial<SeriesAppearanceOptions>) => void | Patch visual config for a single series by index. |