An ART-based sparkline component for react-native
This library is based on [ART][art-library] and works on both Android and iOS platform.
For react-native >= 0.60 ReactNativeART should be auto-linked and no additional action is required.
For react-native < 0.60 you need to link ReactNative ART:
react-native link @react-native-community/art
Manual: [manual-linking]: https://facebook.github.io/react-native/docs/linking-libraries-ios.html#manual-linking
- Install
npm i react-native-sparkline- Use it
import React from 'react'
import Sparkline from 'react-native-sparkline'
const data = Array.from({ length: 20 }).map(
(unused, i) => i + (i + 1) * Math.random()
)
const App = () => (
<Sparkline data={data}>
<Sparkline.Line />
<Sparkline.Fill />
<Sparkline.Spots />
<Sparkline.Band />
</Sparkline>
)cd examplenpm installreact-native run-iosorreact-native run-android
