Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/365.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript &引用;d3.selectAll().style();不将样式应用于选定的图元,但在此选择范围内使用;d3.选择(此).style();如果有效的话_Javascript_D3.js - Fatal编程技术网

Javascript &引用;d3.selectAll().style();不将样式应用于选定的图元,但在此选择范围内使用;d3.选择(此).style();如果有效的话

Javascript &引用;d3.selectAll().style();不将样式应用于选定的图元,但在此选择范围内使用;d3.选择(此).style();如果有效的话,javascript,d3.js,Javascript,D3.js,有了这个css规则,我成功地将不透明度添加到svg中的元素 但在我的脚本中,不透明度不适用于此代码 setTimeout(()=>{ d3.selectAll("#graph4 > svg g.c3-chart-bar.c3-target.c3-target-data3").style("opaciy",0.3) //not works },2000) 但如果适用,我会这样做。为什么? setTimeout(()=>{ d3.selectAll("#graph4 &

有了这个css规则,我成功地将不透明度添加到svg中的元素

但在我的脚本中,不透明度不适用于此代码

setTimeout(()=>{
  d3.selectAll("#graph4 > svg g.c3-chart-bar.c3-target.c3-target-data3").style("opaciy",0.3) //not works
},2000)
但如果适用,我会这样做。为什么?

setTimeout(()=>{
  d3.selectAll("#graph4 > svg g.c3-chart-bar.c3-target.c3-target-data3").style("opaciy",function(){
    d3.select(this).style("opacity",0.3); //it works
    return "";
  });
},2000)

看起来不透明度在两个地方(OpACIY)中拼写错误。

你应该考虑删除你的问题,因为它是一个简单、琐碎的类型,对我们其他人来说没有什么值得学习的。这将有助于消除网站上的混乱。但是,在删除问题之前,您可能需要拒绝回答。
setTimeout(()=>{
  d3.selectAll("#graph4 > svg g.c3-chart-bar.c3-target.c3-target-data3").style("opaciy",function(){
    d3.select(this).style("opacity",0.3); //it works
    return "";
  });
},2000)