-
-
SJQ 初学数据Lv2
发表于2023-5-24 15:34
悬赏1
已解决
楼主
x=0,背景为红色;
0<x<60,背景黄色;
x>100,背景绿色。
0<x<60,背景黄色;
x>100,背景绿色。
2个回答
嵌套if或者用case when都可以实现。
嵌套if
if(x>100,绿色,if(x=0,红色,if(x>0 and x<60,黄色,''))),
if(x>100,'#4cd964',if(x=0,'#f44336',if(x>0 and x<60,'#ffcc00',''))),颜色可以根据需求调整
case when判断
case when x>100 then 绿色
when x=0 then 红色
when x>0 & x<60 then 黄色 end