react-canvas-spark-line
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

SparkLine

CircleCI

Simple canvas SparkLine React component

Examples

Install

npm install react-canvas-spark-line --save --save-exact

Usage

import SparkLine from 'react-canvas-spark-line';
 
const data = [
  1,
  2,
  3
];
 
class MyComponent extends Component {
  render () {
    return (
      <SparkLine
        animate
        animationDuration={2000} // Default: 1000 (milliseconds)
        width={100}
        height={30}
        color="red"
        data={data}
        includeZero={false} // Default: true
        areaOpacity={0} // Default: 0.3
        areaColor={['red', 'white']} // Default: {color}
      />
    );
  }
}

Package Sidebar

Install

npm i react-canvas-spark-line

Weekly Downloads

7

Version

1.0.1

License

MIT

Unpacked Size

44.4 kB

Total Files

23

Last publish

Collaborators

  • jakesidsmith