Chart.js: Deprecation warnings on all horizontal bar charts with Chart.js 2.9.0

Created on 26 Oct 2019  Â·  6Comments  Â·  Source: chartjs/Chart.js

Expected Behavior

No deprecation warnings when not using deprecated options.

Current Behavior

Two deprecation warnings for all horizontal bar charts

bar chart: "scales.[x/y]Axes.barPercentage" is deprecated. Please use "dataset.barPercentage" instead

and

bar chart: "scales.[x/y]Axes.categoryPercentage" is deprecated. Please use "dataset.categoryPercentage" instead

Steps to Reproduce (for bugs)

Change type to horizontalBar in the default codepen: https://codepen.io/ankane/pen/XWWgKZy

Environment

  • Chart.js version: Chart.js 2.9.0
  • Browser name and version: Chrome 78
bug

Most helpful comment

Still seeing this issue on 2.9.3 for vertical bar charts using the following configuration:

    scales: {
      xAxes: [
        {
          stacked: true,
          barPercentage: 0.7,
          categoryPercentage: 0.6
        } as any
      ],
...

All 6 comments

Thanks. I've sent a PR to fix this. You can work around it by changing the default settings as I did in that PR

That was fast, thanks @benmccann!

Chart.js v2.9.1 has been released with a fix for this issue

Great, thanks @etimberg

Still seeing this issue on 2.9.3 for vertical bar charts using the following configuration:

    scales: {
      xAxes: [
        {
          stacked: true,
          barPercentage: 0.7,
          categoryPercentage: 0.6
        } as any
      ],
...

@hevans90 this one helps me: https://stackoverflow.com/a/59732946/7189547

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joebirkin picture joebirkin  Â·  3Comments

nanospeck picture nanospeck  Â·  3Comments

longboy picture longboy  Â·  3Comments

bytesnz picture bytesnz  Â·  3Comments

akashrajkn picture akashrajkn  Â·  3Comments