我想为 d3 图表中的拉丝部分应用一些颜色,为非拉丝区域应用一些颜色。
const brush = d3.brush()
.extent([[0, 0], [width, height]])
.on('start', brushstart)
.on('end', brushed);
svg.append('g')
.attr('class', 'brush')
.call(brush)
const brushSelection = svg.select('.brush .selection');
brushSelection
.attr('fill', 'black')
通过这种方法,我可以为拉丝部分设置颜色,如何为未拉丝区域实现相同的颜色。
好帖子,请提供更多信息。感谢分享。