react-native-sparkline

2.0.0-beta • Public • Published

react-native-sparkline

npm code style: standard code style: prettier

An ART-based sparkline component for react-native

example screenshot

Prerequisite

This library is based on [ART][art-library] and works on both Android and iOS platform.

Linking module

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:

Usage

  • 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 + (+ 1) * Math.random()
)
 
const App = () => (
  <Sparkline data={data}>
    <Sparkline.Line />
    <Sparkline.Fill />
    <Sparkline.Spots />
    <Sparkline.Band />
  </Sparkline>
)

Example

  1. cd example
  2. npm install
  3. react-native run-ios or react-native run-android

License

MIT

/react-native-sparkline/

    Package Sidebar

    Install

    npm i react-native-sparkline

    Weekly Downloads

    12

    Version

    2.0.0-beta

    License

    MIT

    Unpacked Size

    483 kB

    Total Files

    35

    Last publish

    Collaborators

    • arniu