我正在尝试迭代一个数组并基于 y 中的值:我想为图表中的一个点着色。这就是我想要使用的代码的样子,所以索引 0 将是 {x:1,y:1}(我猜这就是为什么它现在不起作用的原因)。我想隔离 y:1 然后用值 === 1 颜色这是我的数组$.each(coords, function( index,value ) {
if(value === 1){
myColors2[index]="#A39FBB";
1 回答

慕姐8265434
TA贡献1813条经验 获得超2个赞
$.each(coords, function( index,value ) { if(value.y === 1){ myColors2[index]="#A39FBB";
添加回答
举报
0/150
提交
取消