Skip to content

jude-io/react-native-sparkline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 and works on both Android and iOS platform.

ART has already been included in react-native, while not avaiable on iOS. Please follow the document to link ART on iOS manually.

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 + (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

About

An ART-based sparkline component for react-native

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors