Chart
The Gravity Web charting library is built with chart.js so you can easily create beautiful, responsive charts in seconds.
Preview
Code
Props
Prop | Description | Required | Value |
---|---|---|---|
color | line color (use array for multiple datasets) | required | red, blue, green, purple or string array |
data | object containing chart data | required | object (see below) |
legend | show the legend | optional | boolean |
type | type of chart to display | required | line, bar, pie, donut or sparkline |
Data Format
Chart data should be in the following format:
You can pass multiple datasets to a line or bar chart by adding to the datasets array.
There is a chart.create
method located inside the /model
directory on the server that you can use to easily format chart data.
Last updated