reactjs / react-chartjs

common react charting components using chart.js
MIT License
2.93k stars 301 forks source link

Allow custom chart types. #12

Closed tcard closed 9 years ago

tcard commented 9 years ago

This changeset exposes the createClass method in lib/core, and adds a third argument to it so that you can pass the dataKey value that was previously fixed in the dataKeys variable.

E. g. if you want to use https://github.com/Regaddi/Chart.StackedBar.js, you would do something like var StackedBarChart = require('react-chartjs').createClass('StackedBar', ['getBarsAtEvent'], 'bars'); (provided you previously registered StackedBar with Chart.js, of course).