React Native Charts
A chart library for React Native. Currently there is support for vertical bar graphs, horizontal bar graphs, and line graphs, with support coming for scatter plots, pie charts, progress rings, and heat maps.
BaseChartConfig
-
startAtZero
?: boolean -
hasXAxisLabels
?: boolean -
hasYAxisLabels
?: boolean -
xAxisLabelCount
?: number (defaults to:4
) -
xAxisLabelStyle
?: {fontFamily
?: stringfontSize
?: numberfontWeight
?: numbercolor
?: stringrotation
?: numberxOffset
?: numberyOffset
?: numberprefix
?: stringsuffix
?: string,position
?: string (accepts:'left'
or'right'
. Defaults to:'left'
)width
?: number,decimals
?: number
}
-
yAxisLabelStyle
?: {fontFamily
?: stringfontSize
?: numberfontWeight
?: numbercolor
?: stringrotation
?: numberxOffset
?: numberyOffset
?: numberheight
?: number
}
-
hasXAxisBackgroundLines
?: boolean -
hasYAxisBackgroundLines
?: boolean -
xAxisBackgroundLineStyle
?: {strokeWidth
?: numbercolor
?: string
}
-
yAxisBackgroundLineStyle
?: {strokeWidth
?: numbercolor
?: string
}
Vertical Bar Graph
Installation
Example
Interface
-
height
: number -
width
: number -
data
:<Array>number
-
labels
?:<Array>string
(defaults to[1, 2, 3, ...]
) -
barRadius
?: number (defaults to0
) -
barWidthPercentage
?: number (defaults to0.7
) -
barColor
?: string (defaults to#000000
) -
style
?:ReactNative.StyleSheet
-
baseConfig
?:BaseChartConfig
(found here: link)
Line Graph
Installation
Example
Interface
-
height
: number -
width
: number -
data
:<Array>number
-
labels
?:<Array>string
(defaults to[1, 2, 3, ...]
) -
hasLine
?: boolean (defaults totrue
) -
lineColor
?: string (defaults to'#000000'
) -
lineWidth
?: number (defaults to3
) -
hasDots
?: boolean (defaulst totrue
) -
dotColor
?: string (defaults to'#000000'
) -
dotSize
?: number (defaulse to5
) -
isBezier
?: boolean (defaults tofalse
) -
hasShadow
?: boolean (defaults tofalse
) -
style
?:ReactNative.StyleSheet
-
baseConfig
?:BaseChartConfig
Horizontal Bar Graph
Installation
Example
Interface
-
height
: number -
width
: number -
data
:<Array>number
-
labels
?:<Array>string
(defaults to[1, 2, 3, ...]
) -
barRadius
?: number (defaults to0
) -
barWidthPercentage
?: number (defaults to0.7
) -
barColor
?: string (defaults to#000000
) -
style
?:ReactNative.StyleSheet
-
baseConfig
?:BaseChartConfig
(found here: link)