1

在此处输入图像描述

正如您在图片中看到的,我有 2 个“配色方案分组”。一种称为“红色”,一种称为“绿色”。我希望将“所有值”的颜色更改为一些不同的颜色。

我希望使用插入按钮的 IronPython 脚本来做到这一点。

我将不胜感激有关哪些http://stn.spotfire.com/dxp/ API 对象代表此配色方案分组以及使用哪些方法进行更改的建议。

4

1 回答 1

2

I realize it's been a while since this was posted, but here's a solution. It doesn't actually use the API objects, but I've found that when using Spotfire, it's important not to overlook workarounds, though I recognize this is a "brute force" solution, and does not allow you the dynamic methodology I'm sure would be preferable.

Create a string Document Property -- I'm calling it ColorSelected here.

For each color you want to add, you need to add a rule.

Click the "Add Rule" button.

Switch the Rule type to "Boolean expression"

Set the Value's expression to "If('${ColorSelected}' = 'a', 1, 0) = 1"

On the action control, add a script with the code: Document.Properties["ColorSelected"] = 'a'

When you click the button, it will set all values to the code of this new rule.

You can add additional rules for new colors in both groupings, and adjust the button scripts following the same logic.

于 2015-08-24T15:04:40.003 回答