trading-peter / chart-elements

Chart.js as Polymer Elements
https://robdodson.github.io/chart-elements
267 stars 70 forks source link

stacked bar #55

Closed mahasaez closed 8 years ago

mahasaez commented 8 years ago

hello, I've been trying to get stacked bar working but haven't succeded, what I tried is this question in stackoverflow

trading-peter commented 8 years ago

You need to use the options property of chart-bar. Also, the data property expects an object holding the data and labels directly. I made a working example with stacking for you:

https://jsbin.com/wohivikole/edit?html,output

mahasaez commented 8 years ago

Thank you very much ! it's working very well thanks !!

May I just ask if the 100% stacked bar like this one http://www.highcharts.com/demo/column-stacked-percent is implemented because I've seen in a lot of issues here that it's impossible to do.

trading-peter commented 8 years ago

Seems like this isn't implemented in Chart.js. Maybe you can manually calculate percentages for your data and use them to achieve some similar? I would recommend to directly address any questions about Chart.js configuration to the Chart.js community on github or stackoverflow.

Anyway, I found this issue: https://github.com/chartjs/Chart.js/issues/2709

Closing this issue, as your original question is resolved.