Class: DomPlatform

    + new DomPlatform(): DomPlatform

    Returns:

    Inherited from: BasePlatform

    acquireContext

    acquireContext(: HTMLCanvasElement, options?: CanvasRenderingContext2DSettings): CanvasRenderingContext2D

    Called at chart construction time, returns a context2d instance implementing the W3C Canvas 2D Context API standard (opens new window).

    Parameters

    Returns: CanvasRenderingContext2D

    Inherited from: BasePlatform

    Defined in:


    addEventListener(chart: Chart<"bar" | "line" | "scatter" | "bubble" | "pie" | "doughnut" | "polarArea" | "radar", (number | | BubbleDataPoint)[], unknown>, type: string, listener: (e: ) => void): void

    Registers the specified listener on the given chart.

    Parameters

    NameTypeDescription
    chart<“bar” | “line” | “scatter” | “bubble” | “pie” | | “polarArea” | “radar”, (number | ScatterDataPoint | )[], unknown>Chart from which to listen for event
    typestringThe (ChartEvent) type to listen for
    listener(e: ) => voidReceives a notification (an object that implements the ChartEvent interface) when an event of the specified type occurs.

    Returns: void

    Defined in:


    getDevicePixelRatio

    getDevicePixelRatio(): number

    Returns: number

    the current devicePixelRatio of the device this platform is connected to.

    Inherited from:

    Defined in: index.esm.d.ts:1937DomPlatform - 图4 (opens new window)


    getMaximumSize(canvas: HTMLCanvasElement, width?: number, height?: number, aspectRatio?: number): object

    Parameters

    Returns: object

    NameType
    heightnumber
    widthnumber

    the maximum size available.

    Inherited from: BasePlatform

    Defined in:


    isAttached

    isAttached(canvas: HTMLCanvasElement): boolean

    Parameters

    true if the canvas is attached to the platform, false if not.

    Inherited from: BasePlatform

    Defined in:


    releaseContext(context: CanvasRenderingContext2D): boolean

    Called at chart destruction time, releases any resources associated to the context previously returned by the acquireContext() method.

    Parameters

    NameTypeDescription
    contextCanvasRenderingContext2DThe context2d instance

    Returns: boolean

    true if the method succeeded, else false

    Inherited from:

    Defined in: index.esm.d.ts:1918 (opens new window)


    removeEventListener

    removeEventListener(chart: Chart<"bar" | | "scatter" | "bubble" | "pie" | "doughnut" | "polarArea" | "radar", (number | | BubbleDataPoint)[], unknown>, type: string, listener: (e: ) => void): void

    Removes the specified listener previously registered with addEventListener.

    Parameters

    Returns: void

    Defined in: