reactjs / react-chartjs

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

Horizontal Bar chart ? #152

Closed nguyenhose closed 6 years ago

nguyenhose commented 7 years ago

hi, I just check on this issue: https://github.com/chartjs/Chart.js/issues/73 And seem react-chartjs doesn't work with options = { invertXY: true } as chartjs: http://jsfiddle.net/xcchcaptain/ye2wdou0/4/

Maybe this option has not implemented yet. Please investigate.

Jareechang commented 7 years ago

please check Chart.js V 1.1.1 docs if that option is available. I think there are plugins that you can incorporate into Chart.js to achieve this though.

Either way, you may be using a later version of Chart.js in your fiddle.

You can always upgrade to Chart.js V2, there is a specific type:

var myBarChart = new Chart(ctx, {
    type: 'horizontalBar',
    data: data,
    options: options
});
nguyenhose commented 7 years ago

Thank you, I changed to react-chartjs-2 package, it worked like charm!

Jareechang commented 6 years ago

This will be available in react-chartjs 2.0 once we have a stable version.