plotly.js
plotly.js copied to clipboard
Stacked area chart - Avoid zero padding to clean up hovertool
When I hover over a stacked line chart, it shows zeroes for all lines not in range. Is there a way to hide these values rather than adding noise to the hover tool?
Plotly.newPlot('test', [{
line: { shape : 'vh' },
stackgroup: '1',
x: [1, 2],
y: [1, 1],
}, {
line: { shape : 'vh' },
stackgroup: '1',
x: [3, 4],
y: [2, 2],
}, {
line: { shape : 'vh' },
stackgroup: '1',
x: [3, 4, 5, 6],
y: [3, 3, 3, 3],
}], {
hovermode: 'x unified',
width: '100%',
});
As a jsfiddle and image:
(Cross-post from StackOverflow, which also provides an example use case where this matters)