Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Latest commit

 

History

History
66 lines (39 loc) · 1.76 KB

charts.md

File metadata and controls

66 lines (39 loc) · 1.76 KB

Charts

Table of Contents

Available Charts

The charts available are in the visuals object

Crate a chart

It is possible to expand the library by creating custom charts via the createChart function.

import createChart from 'd3-visualise';

API

The chart API is implemented in the vizPrototype object. Plugins extend the prototype with methods.

chart.dataStore

Plugin: data, Read-only

The data store associated with the chart. It is injected during chart initialisation by the data plugin.

chart.draw ([fecthData])

Draw the chart and return a Promise which resolve in true or false indicating if the chart was successfully drawn in the DOM.

chart.getContext([context])

Plugin: data

Returns a new model context as a child of the dataStore context.

chart.getData ()

Plugin: data

Retrive data from the datastore. This is a safe function and it never throws an error. If data could not be retrived it logs the warning or exception and returns nothing.

chart.getStack ()

Plugin: shapes

Return a stack object configured by the chart.model.stack entry.