Hello,
I’m trying to add a rectangular shape to my chart but it’s not showing up.
Here is the code by which I add the rectangle:
layout.shapes = _.map(regions, function(region) {
return {
type: 'rect',
xref: 'x',
yref: 'paper',
y0: 0,
y1: 1,
x0: region.start, // 8/13/2023 12:01:00 AM
x1: region.end, // 8/15/2023 12:01:00 AM
fillcolor: '#d3d3d3',
opacity: 1.0,
line: {
width: 3
}
};
});
Here’s the series of events that need to occur.
- starting with the chart (a scatter plot):
- select a point with the lasso tool:
- delete the point:
- draw the rectangular region:
It’s 4) that’s failing to occur. Can anyone see what I’m doing wrong?