I need to implement something similar except with rectangular shaped selections (so the user clicks and drags the mouse across a region on the chart and a rectangle is draw from the click point to the release point). Something like this might work: https://observablehq.com/@cbt1/picasso-js-range-brushing ... except it has to work on a scatter plot, not a bar chart. Also, ideally the user would be able to click and drag inside the chart, not on the axes.