【问题标题】:Conditional formatting in Dash Table is not workingDash Table 中的条件格式不起作用
【发布时间】:2019-07-21 16:21:42
【问题描述】:

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

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

{'if': {'column_id': '24H Base', 'filter': 'num(24H Base) > num(4)'},
'backgroundColor': '#3D9970',
'color': 'white'}
  1. 关于使用最新库 - 甚至不显示表格
  2. 旧版库(Dash Table v 3.7)代码不会格式化特定单元格,但会显示表格

两种情况都不显示错误信息

【问题讨论】:

    标签: plotly-dash


    【解决方案1】:

    尝试filter_query 而不是filter

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-08-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多