【问题标题】:Can I change the font color and background color of a Spotfire cross table at the same time?我可以同时更改 Spotfire 交叉表的字体颜色和背景颜色吗?
【发布时间】:2019-08-28 02:13:31
【问题描述】:

我能够一次更改一个交叉表的字体颜色和背景颜色。报表的要求是字体着色和背景着色有不同的条件。

Cross Table Requirement 我只能设置字体颜色或背景颜色,但不能同时设置两者。是否有变通办法来获得上述结果?

【问题讨论】:

    标签: fonts background-color spotfire


    【解决方案1】:

    仅使用 spotfire 选项是不可能的。您必须在颜色或背景颜色之间进行选择。

    这里有一个小技巧可以做你想做的事,但请注意,这不是高度可维护的,并且可能会在 Spotfire 的未来版本中停止工作:

    1. 根据您的需要根据背景颜色设置颜色
    2. 如果启用,则禁用 HTML 清理(在 Spotfire 管理员选项中)
    3. 在您的页面上添加一个 textArea(或使用现有的)
    4. 添加以下代码(根据您的需要进行调整)

      $(".sfc-cross-table .sfc-value-cell div.cell-text").each( () => {
          if ( this.innerHTML == "OK" ) {
              this.style.color = "green";
          } else {
              this.style.color = "red";
          }
      });
      

    我建议您在 Spotfire ideas portal 上发布您的想法,以便将来的 spotfire 版本可以考虑您的功能。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-01-15
      • 2018-10-22
      • 1970-01-01
      • 2014-07-30
      • 1970-01-01
      • 2019-06-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多