Skip to main content
Module

x/fresh_charts/deps.ts>ChartJs.LayoutItem

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

Properties

position: LayoutPosition

The position of the item in the chart layout. Possible values are

weight: number

The weight used to sort the item. Higher weights are further away from the chart area

fullSize: boolean

if true, and the item is horizontal, then push vertical boxes down

width: number

Width of item. Must be valid after update()

height: number

Height of item. Must be valid after update()

left: number

Left edge of the item. Set by layout system and cannot be used in update

top: number

Top edge of the item. Set by layout system and cannot be used in update

right: number

Right edge of the item. Set by layout system and cannot be used in update

bottom: number

Bottom edge of the item. Set by layout system and cannot be used in update

Methods

optional
beforeLayout(): void

Called before the layout process starts

draw(chartArea: ChartArea): void

Draws the element

optional
getPadding(): ChartArea

Returns an object with padding on the edges

isHorizontal(): boolean

returns true if the layout item is horizontal (ie. top or bottom)

update(
width: number,
height: number,
margins?: ChartArea,
): void

Takes two parameters: width and height.