RUI.next

Experimental
Chart

Chart

Chart made with SVG, supports polylines printing and display setting (experimental status).

<Chart labels={[]} datasets={[]}/>
<Chart labels={[]} datasets={[]}/>

Example

Basic usage of Chart component.

Line and Area-fill Chart
60%50%40%30%20%4%MonTueWedThuFriSatSun
Gradient-line Chart
60504030203MonTueWedThuFriSatSun

API

PropertiesDescriptionTypeDefault
sizeThe size of chart, the value can be a string or number with unit (px)Array[480, 320]
maxThe maximum in Y-AxisNumberLeave it as blank to automatically calculate the maximum in the dataset
minThe minimum in Y-AxisnumberLeave it as blank to automatically calculate the minimum in the dataset
linesThe number of lines in Y-AxisNumber5
stepThe decreasing step in Y-AxisNumberLeave it as blank to automatically compute the avarage based on lines,max and min
formatThe labels formatting function in Y-AxisFunction(val) => val
labelsThe labels of X-Axis, required propertyArray-
datasetsThe chart data, the format is shown as follows, required propertyArray-
shiftThe shift in Y-AxisNumber0.6