Interface ComparisonChartHost

The slice of the chart this controller needs. Chart satisfies it; declaring it structurally keeps the controller testable against a stub.

interface ComparisonChartHost {
    dataLayer: {
        length: number;
        indexToTime(index: number): undefined | number;
    };
    addPrimitive(primitive: IPrimitive, paneIndex?: number): void;
    addSeries(type: SeriesType, options: AddSeriesOptions): SeriesApi;
    getVisibleLogicalRange(): { from: number; to: number };
    on(event: string, callback: (payload: unknown) => void): () => void;
    panes(): readonly ComparisonPane[];
    primaryBars(): readonly Bar[];
    primaryPaneIndex(): number;
    primarySeries(): null | SeriesApi;
    removePrimitive(primitive: IPrimitive): void;
}

Properties

dataLayer: { length: number; indexToTime(index: number): undefined | number }

The shared logical axis locates visible primary bars even when another series adds times.

Methods

  • Parameters

    • event: string
    • callback: (payload: unknown) => void

    Returns () => void

  • Slot of the price pane, the default target. Absent means slot 0.

    Returns number