AutoChart
Ever wanted to create a very simple GraphJs chart in seconds chart in seconds to display a dataset you already have? Not for a fancy B2C display but just to see what it's like?
AutoChart is a minimalistic no-dependances package which can accept both objects and array data structure to create a simple graph for you to see.
NodeJS users, you might want to try out quickChart to visualize autochart data inside a browser.
The available chart types are bar
, line
, radar
, doughnut
, pie
and polarArea
.
Installation
npm i autochart
Usage
autochart(data)
const autochart = const data = A: a: 1 b: 2 B: a: 2 c: 3 autochartautochartautochartautochartautochartautochart
data
can be either an object or an array, in one or two dimensions :
const objectChart = autochart /* Returns */ type: "bar" data: labels: "A" "B" datasets: label: "a" backgroundColor: "#F44336" data: 1 2 label: "b" backgroundColor: "#2196F3" data: 2 3
const arrayChart = autoChart /* Returns */ type: "bar" data: labels: "0" datasets: label: "0" backgroundColor: "#F44336" data: 1 2
Note : hybrid types are possible and missing values are OK
License
MIT © Ivan Sedletzki - Please use and share at will
Special thanks to Dinesh Pandiyan for npm-module-boilerplate