0.1.5 • Published 5 years ago
@chartiful/react-line-graph v0.1.5
Line Graph
Installation
npm i @chartiful/react-chart-builder @chartiful/react-line-graphExample
import LineGraph from '@chartiful/react-line-graph'
<LineGraph
data={[10, 15, 7, 20, 14, 12, 10, 20]}
width={500}
height={300}
lineColor='#347975'
dotColor='#347975'
lineWidth={3}
isBezier
hasDots={true}
baseConfig={{
startAtZero: false,
hasXAxisBackgroundLines: false,
xAxisLabelStyle: {
prefix: '$',
offset: 0
}
}}
style={{
marginBottom: 30,
padding: 10,
paddingTop: 20,
borderRadius: 20,
width: 500,
backgroundColor: `#dbf0ef`
}}
/>Interface
height: numberwidth: numberdata:<Array>numberlabels?:<Array>string(defaults to[1, 2, 3, ...])hasLine?: boolean (defaults totrue)lineColor?: string (defaults to'#000000')lineWidth?: number (defaults to3)hasDots?: boolean (defaults totrue)dotColor?: string (defaults to'#000000')dotSize?: number (defaults to5)isBezier?: boolean (defaults tofalse)hasShadow?: boolean (defaults tofalse)style?:ReactNative.StyleSheetbaseConfig?:BaseChartConfig(found here: link)