Dash Table 中的条件格式不起作用 [英] Conditional formatting in Dash Table is not working

查看:103
本文介绍了Dash Table 中的条件格式不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试根据数值为某些单元格着色,但代码不起作用(不显示任何内容).有办法解决吗?

I am trying to color some cells based on their numerical value but the code doesn't work (Doesn't display anything). Is there a way to fix it?

我已尝试使用 Dash Table 文档中提到的所有技术 (https://dash.plot.ly/datatable/style) 它没有用.还将库升级到最新版本,代码甚至停止显示表格,所以我切换回旧版本的 Dash_Table

I have tried using all techniques mentioned in Dash Table Documentation (https://dash.plot.ly/datatable/style) it didnt work. Also upgraded the libraries to latest version and the code stopped displaying even the table, so I switched back to older version of Dash_Table

{'if': {'column_id': '24H Base', 'filter': 'num(24H Base) > num(4)'},
'backgroundColor': '#3D9970',
'color': 'white'}

  1. 关于使用最新的库 - 甚至不显示表
  2. 较旧的库(Dash Table v 3.7)代码不会格式化特定单元格,但会显示表格

两种情况都没有显示错误信息

Both cases No error message is displayed

推荐答案

尝试 filter_query 而不是 filter:

{'if': {'column_id': '24H Base', 'filter_query': 'num(24H Base) > num(4)'},
'backgroundColor': '#3D9970',
'color': 'white'}

这篇关于Dash Table 中的条件格式不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆