question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

xAxes: Stacked doesn't appear to work

See original GitHub issue

It appears that setting scales.xAxes[0].stacked = true in the options does not have an effect in react-chartjs-2, even though it works as expected in vanilla Chart.js.

      scales: {
        xAxes: [{
          stacked: true
        }]
      }

Demo: https://www.webpackbin.com/bins/-KeYdil1aIYyXyNOoybq The result should be that the bars are stacked on top of one another.

Any idea why it doesn’t work?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
timwiscommented, Mar 14, 2017

@AdeelK93 actually, Chart.js did support this functionality, which is one of the main reasons I explored the library further. But it seems like v2.5 introduced a regression breaking this functionality.

Example of the desired functionality using Chart.js v2.4: https://www.webpackbin.com/bins/-KfBFWirodI6k6U1b-bx

I’ll post this issue in the Chart.js repository. For now, the solution w/react-chartjs-2 is to use v2.4 of Chart.js as its peer dependency. So it’s okay to close this issue if you see fit.

EDIT: Posted at chartjs/Chart.js#4014

0reactions
jerairrestcommented, Jul 13, 2017

I believe it can be now. 😃 If there’s still troubles please reopen

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue with x axis stacking for a stacked bar chart #5072 - GitHub
I'm trying to build a stacked bar chart based on a time series x axis. The chart doesn't seem to stack correctly on...
Read more >
geom_area doesn't show data, supposedly because of x-axis ...
geom_area doesn't show data, supposedly because of x-axis data ... I want to create a stacked area plot based on a data frame....
Read more >
Solved: Stacked column chart - Want to fill missing X-Axis...
Hi,. I'm having a problem in Power BI Desktop when trying to create a stacked column chart that has a relative date filter...
Read more >
How do i make sure 'all' the x axis labels are displayed and ...
In the stacked column chart below, you can see that every bar doesn't have a corresponding label, how do I force TS to...
Read more >
Customize X-axis and Y-axis properties - Power BI
To set the Y-axis values, from the Fields pane, select Sales > Last Year Sales and Sales > This Year Sales > Value....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found