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.

Stacked bar visualisation on 2.6.0

See original GitHub issue

After upgrading from chart.js 2.5.0 to 2.6.0 stacked bar visualisations aren’t stacking any more - will try to look into chart.js code and make a pull request if successful.

2.5.0

screenshot 2017-06-26 16 19 39

2.6.0

screenshot 2017-06-26 16 20 00

Code

new Chart(chartContainer, {
    "type": "bar",
    "data": {
        "labels": context.contextLabels,
        "datasets": datasets
    },
    "options": {
        "scales": {
            "yAxes": [{
                "stacked": true,
                "ticks": {
                    "min": 1,
                    "max": max > 100 ? max : 100
                }
            }]
        }
    }
});

Edit (SB): code formatting

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
simonbrunelcommented, Jun 26, 2017

This is how stacked works on both axes in 2.6.0:

image

@jungleBadger you can still create a fiddle with your code

1reaction
simonbrunelcommented, Jun 26, 2017

@jungleBadger that’s actually a bug fix, the 2.6.0 screenshot is the expected result: stacked on y but not on x. I think setting stacked: true on the x axis should produce the result you want?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stacked bar visualization - IBM
Use a stacked bar visualization to compare the proportional contributions for each item to the total, such as sales for products and sales...
Read more >
Stacked and Grouped Bar Charts and Mosaic Plots in R
Stacked and Grouped Bar Charts and Mosaic Plots in R: How to create and customize stacked bar charts, clustered bar charts and mosaic...
Read more >
How to change the order of the bars in your stack bar chart
Changing the order of your stacked bar chart.
Read more >
Excel - Stacked bar chart of single variable - YouTube
Add Total Values for Stacked Charts in Excel: Column & Bar Charts · 2D Stacked Bar chart in MS Excel - Project Schedule...
Read more >
Constructing a Stacked Bar Graph - YouTube
This video show how to construct a stacked bar graph.
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