ReactFlot - A react component for using Flot
For information about Flot library go here.
It is required to have jQuery available. If you are using webpack, it is possible to provide jQuery using a plugin.
module.exports = {
...
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
}),
],
...
}import ReactFlot from 'react-flot';
render () {
return (
<ReactFlot id="product-chart" options={options} data={data} width="50%" height="100px" />
);
}@idis the id of the chart. It is required and must be unique@optionsis the options based on flot documentation@datais the data based on flot documentation@widthis the width of the component (default to 100%)@heightis the height of the component (default to 400px)
Pie Chartfrom http://www.flotcharts.org/flot/examples/series-pieTooltipfrom https://github.com/krzysu/flot.tooltipResizefrom http://www.flotcharts.org/flot/examples/resize/index.html
If you want other plugins it is possible to import them.
require('../node_modules/react-flot/flot/jquery.flot.time.min');
// OR
import '../node_modules/react-flot/flot/jquery.flot.time.min';Would you like to contribute to this library? Don't be shy! Contact me if you are interested on it.