Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

Commit 1afe9f1 broke stacked bar

Open Dergonic opened this issue 10 years ago • 3 comments

Hi

I just update the Chart.js with the last commit (From commit 888379e to 1afe9f1).

As soon as I updates, StackedBar charts broke.

The Y axis is no more starting at 0 (despite the beginAtZero:true option). Graph content (bar) also goes under the x Axes and way behind. It "looks" like the graphs goes vertically out of the canvas border

If I got back the 'chart.js' file to last commit, everything is back normal.

I inspect the code and see the mistake if coming from line 5646 of the new file. As soon as I put this line back as it was in previous version, it works !

It looks like the '.concat(valuesForType.negativeValues)' part (that has been removed) was adding 0's at the end. This changes is important because of the line 5647 just after that takes the minimum !

For your info, in the graph, I only have positive values

Hope I've given enough info for problem solving If not, just ask ;)

PS : there is also a semicolon missing at the end of line 5648 ;)

Dergonic avatar Feb 01 '16 09:02 Dergonic

@Dergonic this is definitely a bug. I'll try and get this fixed ASAP

etimberg avatar Feb 01 '16 16:02 etimberg

@Dergonic I tested out the beginAtZero option. It appeared to work. Not using the beginAtZero option is broken.

scales: {
    yAxes: [{
        ticks: {
            beginAtZero: true
        }
    }]
}

etimberg avatar Feb 01 '16 23:02 etimberg

Fixed in #1963 Pushing up new built files now

etimberg avatar Feb 01 '16 23:02 etimberg