Class: BasePlatform

    new BasePlatform()

    acquireContext

    acquireContext(canvas, options?): CanvasRenderingContext2D

    Called at chart construction time, returns a context2d instance implementing the .

    Parameters

    Returns

    CanvasRenderingContext2D

    Defined in


    addEventListener(chart, type, listener): void

    Registers the specified listener on the given chart.

    Parameters

    NameTypeDescription
    chart<“bar” | “line” | “scatter” | “bubble” | “pie” | “doughnut” | “polarArea” | “radar”, (number | ScatterDataPoint | )[], unknown>Chart from which to listen for event
    typeThe (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.

    Defined in

    index.esm.d.ts:1967 (opens new window)


    getMaximumSize(canvas, width?, height?, aspectRatio?): Object

    Parameters

    Returns

    Object

    the maximum size available.

    NameType
    heightnumber
    widthnumber

    Defined in

    index.esm.d.ts:1975BasePlatform - 图5 (opens new window)


    isAttached

    isAttached(canvas): boolean

    Parameters

    Returns

    Defined in


    releaseContext(context): 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

    Defined in


    removeEventListener

    removeEventListener(chart, type, listener): void

    Removes the specified listener previously registered with addEventListener.

    Parameters

    Returns

    Defined in

    index.esm.d.ts:1963 (opens new window)