Open joshreeder opened 6 years ago
Unable to replicate the bug, can you provide more info
To replicate, just try to show two stacked bar datasets with one having negative values.
Here is an example that shows the issue on version 1.6.1:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script type="module">
import {Chart} from './static/scripts/frappe-charts.esm.js';
const data = {
labels: ["12am-3am", "3am-6pm", "6am-9am", "9am-12am",
"12pm-3pm", "3pm-6pm", "6pm-9pm", "9am-12am"
],
datasets: [
{
name: "Dataset 1",
values: [18, 40, 30, 35, 8, 52, 17, -4],
},
{
name: "Dataset 2",
values: [-10, -15, -2, 0, 0, -10, -60, -30],
}
]
}
new Chart("#chart", {
title: "My Awesome Chart",
data: data,
type: 'bar',
height: 250,
colors: ['#7cd6fd', '#743ee2'],
barOptions: {'stacked': true}
})
</script>
<div id="chart"></div>
</body>
</html>
I can confirm. This is an issue. Hope it will be fixed soon.
Expected Behaviour
negative value bar shows below 0 line
Actual Behaviour
negative value bar shows same as positive value bar - above 0 line