我使用的是nvd3.js离散条http://nvd3.org/ghpages/discreteBar.html
我正在检查代码,发现颜色是内联派生的
style="fill: #ffbb78; stroke: #ffbb78;"我还跟踪了discreteBarChart函数
color = nv.utils.getColor()我没有意识到的是,我想问的是,颜色作为参数是什么?
发布于 2013-07-18 17:01:39
发布于 2016-04-21 18:50:23
如果你想使用一种颜色,那么它可以从options对象中返回,如下所示:
var options={
....
colour:function(){
return '#ff0000';
},
...
..
}
https://stackoverflow.com/questions/17708361
复制相似问题