-
-
Notifications
You must be signed in to change notification settings - Fork 197
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Negative numbers in datasets are not shown in StackedBar, mess up labels, or end up going below the origin even for the "positive stack"
Screenshot
If applicable, add screenshots to help explain your problem.

How to reproduce
<svg class="chart"></svg>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.xkcd.min.js"></script>
<script>
const svg = document.querySelector('.chart');
new chartXkcd.StackedBar(svg, {
data: {
labels: ["normal","-20","-30"],
datasets: [{
label: 'Red',
data: [10,-20,-30],
}, {
label: 'Blue',
data: [20,20,20],
}],
}
});
</script>
or see https://jsfiddle.net/3dpbg241/
Additional context
I'd expect at least the positive dataset to stay above the line, and the labels to match up. Preferably, I'd get the "Red" in the example going below the line, and "Blue" above, and the Ylabel line would continue below the origin.
yikerman
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working