SetTextType 定义用于指定应该在仪表板中某处放置用户定义文本的操作。
文本可以是对表达式求值后的动态结果,即可以显示 metric、counter、stopwatch 和 KPI。
您可以设置文本的颜色。您可以用下列两种方法之一来指定文本的位置:
- 定义引用 SVG 图中文本元素的 shapeSet。执行该操作时,此文本元素会将它的值设置为指定的文本。由于可以使用图中已存在的文本节点,所以这是使用 setText 操作的最有效的方法。
- 将文本放置在 SVG 图上,以使用 X 和 Y 绝对坐标来指定放置文本的位置。
- 元素
| Name |
最小最大出现次数 |
Description |
| shapeSet |
1 - 1 |
shapeSet 定义用于放置文本的文本 SVG 元素。必须提供 shapeSet 或 textPosition 元素,以定义文本的放置位置。 |
| textPosition |
1 - 1 |
用于文本位置的 X 和 Y 坐标。
必须提供 textPosition 或 shapeSet 元素,以定义放置文本的位置。 |
- 属性
-
- 限制
- shapeSet 引用(如果存在)必须引用 shapeSet,并且引用的这个 shapeSet 必须包含对 SVG 文本元素的引用,这样该文本元素的值才能在运行时由已解析的 textValue 属性值覆盖。
- textColor 必须符合 W3 CSS 规范,该规范位于:http://www.w3.org/TR/REC-CSS2/syndata.html#value-def-color。
- 所有对 ActionType 的限制均适用于 SetTextType。
- shapeSet 引用必须在同一可视化表示的 shapeSet 标识集中。
- textValue 表达式必须是有效的。
- textValue 属性表达式初始上下文是可视上下文属性所引用的上下文。
- textValue 属性表达式范围是 BaseMetrics(如果任何一个位于所引用的上下文中)或 KPI 值。
- textValue 属性表达式的求值结果必须为字符串值。
- 模式定义
<xsd:complexType name="SetTextType">
<xsd:complexContent>
<xsd:extension base="mon:ActionType">
<xsd:choice minOccurs="1" maxOccurs="1">
<xsd:element name="shapeSet" type="mon:ShapeSetRefType" />
<xsd:element name="textPosition" type="mon:PositionType" />
</xsd:choice>
<xsd:attribute name="textValue" type="xsd:string"
type="xsd:anyType"/>
<!-- See http://www.w3.org/TR/REC-CSS2/syndata.html#value-def-color
for description of color values -->
<xsd:attribute name="textColor" type="xsd:string"
use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>