dc-js / dc.js

Multi-Dimensional charting built to work natively with crossfilter rendered with d3.js
Apache License 2.0
7.42k stars 1.81k forks source link

canvas scatter should move svg to z-index 1, not canvas to z-index -1 #1786

Open gordonwoodhull opened 3 years ago

gordonwoodhull commented 3 years ago

This SO question:

https://stackoverflow.com/questions/64904578/how-do-i-change-the-z-index-of-a-canvas-element-for-dc-js-plot

points out that moving the canvas behind its div, as done here:

https://github.com/dc-js/dc.js/blob/5d984c840e168aede1a4338d086d9f376118e885/src/charts/scatter-plot.js#L150

means that changes to the background color will erase the scatter dots.

My answer shows that changing the z-index of the svg is a better move.