Skip to content

grafit-charts


Interface: ChartOptions ​

Properties ​

animation? ​

optional animation?: AnimationOptions


annotations? ​

optional annotations?: AnnotationOptions[]


axes? ​

optional axes?: PolarAxesOptions | AxisOptions[]

Axes of the chart: a list for a cartesian one, a pair — the categories around the rim and the values along the radius — for a polar one.


background? ​

optional background?: BackgroundOptions


container? ​

optional container?: HTMLElement


contextMenu? ​

optional contextMenu?: ContextMenuOptions


crosshair? ​

optional crosshair?: CrosshairOptions


data? ​

optional data?: Datum[]


fonts? ​

optional fonts?: FontsOptions

Handling of web fonts that are still loading when the chart draws.


gradientLegend? ​

optional gradientLegend?: GradientLegendOptions

Color scale for colorField series (heatmap).


height? ​

optional height?: number


highlight? ​

optional highlight?: HighlightOptions


initialState? ​

optional initialState?: ChartState


legend? ​

optional legend?: LegendOptions


listeners? ​

optional listeners?: ChartListeners


loading? ​

optional loading?: boolean

Shows the "Loading…" overlay.


locale? ​

optional locale?: LocaleOptions


minHeight? ​

optional minHeight?: number


minWidth? ​

optional minWidth?: number

Floor under the size measured off the container, px — default 300 and 200. 0 removes the floor: the chart is then exactly as small as the container is, which is what a dense dashboard tile or a KPI sparkline wants. Ignored on the axis a numeric width/height fixes.


optional navigator?: NavigatorOptions


overlays? ​

optional overlays?: OverlaysOptions


padding? ​

optional padding?: PaddingValue


responsive? ​

optional responsive?: boolean

Whether the chart follows its container through a ResizeObserver. By default it does unless both width and height are numbers. Set it and the two stop deciding it: responsive: true alongside width/height leaves them as the size to start from — the size a container with no box yet is drawn at — and the container decides every size after that; responsive: false measures once and never again.


selection? ​

optional selection?: SelectionOptions

Datum selection via rubber band/clicks + listeners.selectionChange.


series? ​

optional series?: SeriesOptions[]


subtitle? ​

optional subtitle?: CaptionOptions


sync? ​

optional sync?: SyncOptions


theme? ​

optional theme?: ThemeName | ThemeOptions


title? ​

optional title?: CaptionOptions


tooltip? ​

optional tooltip?: TooltipOptions


width? ​

optional width?: number

Without width/height the chart follows its container (ResizeObserver).


zoom? ​

optional zoom?: ZoomOptions