I am using the following code
const t1 = {
x: [1,2,3,4,5],
y: [2,3,-3,4,-2],
name:'Positive',
showlegend: true,
type: 'bar',
}
const t2 = {
x: [1,2,3,4,5],
y: [-2,-4,4,-6,3],
name:'Negative',
showlegend: true,
type: 'bar',
}
const data = [t1, t2,];
const layout = {
xaxis: {title: 'X axis'},
yaxis: {title: 'Y axis'},
barmode: 'relative',
title: 'Relative Barmode'
};
Plotly.newPlot('myDiv', data, layout);
This is pretty much lifted from the official docs except data.
The exact same code run with plotly.js 1.5 on my machine looks like follows
My aim is obviously to get the output in the codepen above.
This is similar to barmode group I think rather than relative.
Is this a bug or am I missing something?
Thanks