reactjs / react-chartjs

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

Include HorizontalBar as an available type #122

Closed OddEssay closed 7 years ago

OddEssay commented 8 years ago

This adds horizontalBar as an available type of chart.

There is a small refactor to the way the type passed into chart.js to account for more that can be covered by a simple ternary assignment.

achanda commented 7 years ago

Can we merge this, please?

achanda commented 7 years ago

Thanks for taking care of this @austinpray ! When can we expect a new release on npm with this fix?

austinpray commented 7 years ago

published as 2.0.0-beta1

achanda commented 7 years ago

Thanks for publishing it. npm still shows 0.8.0 though. This is the one, right? https://www.npmjs.com/package/react-chartjs

evanheisler commented 7 years ago

@achanda you can install the specific version with npm install react-chartjs@2.0.0-beta1 which does in fact have these changes, however I still couldn't render a horizontal bar chart.

To do so, I had to add the export to index.js:

module.exports = {
  Bar: require('./lib/bar'),
  HorizontalBar: require('./lib/horizontal-bar'),
...

Edit: Just opened a pull request https://github.com/reactjs/react-chartjs/pull/179