react-canvas-spark-line
v1.0.1
Published
Simple canvas SparkLine React component
Downloads
55
Maintainers
Readme
SparkLine
Simple canvas SparkLine React component
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}
/>
);
}
}