apertureless / vue-chartjs

📊 Vue.js wrapper for Chart.js
https://vue-chartjs.org
MIT License
5.55k stars 837 forks source link

Vertical Bar Chart: Strange behavior wehn barchart when dataset has only one bar to display #285

Closed AndreaMinato closed 6 years ago

AndreaMinato commented 6 years ago

Case

Bar Chart with weekdays from Monday to Sunday and only Monday has values on the dataset.

Expected Behavior (2.8.6 -)

I want to see the bar over the monday label like this

image

Actual Behavior (2.8.7 +)

I see the bar between Tuesday and Wednesday labels like this

image

Environment

apertureless commented 6 years ago

Can you provide a link for reproduction? codepen / jsfiddle / webpackbin ?

However I think the is related to the updated chart.js lib which got updated to 2.7.0

https://github.com/chartjs/Chart.js/releases/tag/v2.7.0

Because from 2.8.6 up to 2.8.7 only the dependencies were updated. I guess you have to pass some options which got removed as default options from chart.js

Have you checked the configuration of barcharts? http://www.chartjs.org/docs/latest/charts/bar.html#configuration-options

AndreaMinato commented 6 years ago

Here is the link to codepen https://codepen.io/anon/pen/GyQrmr?editors=1010

apertureless commented 6 years ago

Hm, yeah this seems to be buggy. I guess its because you have more labels then datasets. However, you should report this directly to chartjs. As this is imo a bug in chart.js directly, rather then vue-chartjs