Skip to main content
Module

x/fresh_charts/deps.ts>ChartJs.BasePlatform

A server-side-rendered charting library for Fresh
Go to Latest
class ChartJs.BasePlatform
import { ChartJs } from "https://deno.land/x/fresh_charts@0.2.0/deps.ts";
const { BasePlatform } = ChartJs;

Methods

acquireContext(canvas: HTMLCanvasElement, options?: CanvasRenderingContext2DSettings): CanvasRenderingContext2D | null

Called at chart construction time, returns a context2d instance implementing the [W3C Canvas 2D Context API standard]https://www.w3.org/TR/2dcontext/.

addEventListener(
chart: Chart$4,
type: string,
listener: (e: ChartEvent$1) => void,
): void

Registers the specified listener on the given chart.

getMaximumSize(
canvas: HTMLCanvasElement,
width?: number,
height?: number,
aspectRatio?: number,
): { width: number; height: number; }
isAttached(canvas: HTMLCanvasElement): boolean
releaseContext(context: CanvasRenderingContext2D): boolean

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

removeEventListener(
chart: Chart$4,
type: string,
listener: (e: ChartEvent$1) => void,
): void

Removes the specified listener previously registered with addEventListener.

Updates config with platform specific requirements