Show Straight Vertical Line based on Document 属性 下拉选择

Show Straight Vertical Line based on Document Property drop-down selection

我面临的问题很容易理解但很难解决(至少对我而言)。我没有找到太多谷歌搜索。

问题:仅当文档 属性 选择了“x”时,我想在折线图上包含一条代表固定值 28 的直线,否则,如果文档 属性 " y" 被选中时,直线应该从 28 移动到 10,如果文档 属性 选择了值 "z",那么直线应该消失 (NULL)。

顺便说一下,这是同一个文档 属性(名为 ${firstStartORAssignedTime} 的下拉选择。

提前致谢,抱歉没有代码!

在折线图中属性 > 折线和曲线 > 添加水平线作为自定义表达式并使用以下内容:

case  when "${firstStartORAssignedTime}"='x' then 28
when "${firstStartORAssignedTime}"='y' then 10
else null end

${DocumentPropertyName}

将 return 文档中的 TEXT 值 属性 因此需要将其包装在 " " 中作为表达式。

DocumentProperty("DocumentPropertyName")

将Return文档的值属性(即:字符串、整数等)

所以你也可以使用:

case  when DocumentProperty("firstStartORAssignedTime")='x' then 28 
when DocumentProperty("firstStartORAssignedTime")='y' then 10
else null end