react-barchart-envelope
v0.2.0 react react-component component barchart-envelope graph d3
react-barchart-envelope
React component for simple barchart envelope
Demo
http://fraserxu.me/react-barchart-envelope/
Installation
$ npm install react-barchart-envelope --save
Usage
var React = require('react')
var BarchartEnvelope = require('react-barchart-envelope')
var Graph = React.createClass({
render: function() {
var data = [15, 12, 25, 8, 20, 14, 15, 3, 9, 29, 23, 12, 10, 26, 17, 25, 4, 29, 23, 12, 10, 26, 17, 25, 4, 29, 23, 12, 10, 26, 17, 25]
var onBarchartClick = function(d) {
console.log(d)
}
return (
<div>
<BarchartEnvelope data={data} onBarchartClick={onBarchartClick} hoverEffect={true}/>
</div>
)
}
})
React.render(<Graph />, document.body)
Options
onBarchartClick={onBarchartClick}
barchart click event listenerhoverEffect={true}
settrue
to have hover effect on the charttooltip={true}
settrue
to add tooltip to the chartwidth
set the width of the chartheight
set the height of the chartstrokeColor
set the color of the strokestrokeWidth
set the width of the stroke
License
MIT
npm i react-barchart-envelope
Metadata
- MIT
- Whatever
- Fraser Xu
- released 12/16/2014