如何用selectAll选择多个选择器? [英] How to select multiple selectors with selectAll?
问题描述
是否可以使用 selectAll
在D3中选择多个选择器?
我想要像 这是否可能? 在选择器字符串中,而不是传递单独的字符串: 我假设class1是css类,circle是标签名称, 是ID属性值。 Is it possible to select multiple selectors in D3 using I want something like Is this possible? Yes, you simply put the commas inside the selector string rather than passing separate strings: I am assuming that "class1" is a css class, "circle" is a tag name, and "id2" is an ID attribute value. 这篇关于如何用selectAll选择多个选择器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! svg.selectAll(class1,circle,id2)
元素和
元素,
class1
元素和 id2
元素。 / p>
svg.selectAll(。class1,circle,#id2)
selectAll
? svg.selectAll("class1", "circle", "id2")
to select all circle
elements, class1
elements and id2
elements.svg.selectAll(".class1, circle, #id2")