Computed Style
The ComputedStyle element provides functionality for a user to style a data measure using a groovy expression.
<
DM
bucketization
=
"DAILY"
>
<
Name
>RequestQuantity</
Name
>
<
DisplayName
>Request Quantity</
DisplayName
>
<
ComputedStyle
>
<![CDATA[
def style = null
if (bucket.value == 1)
style = "font-style: italic; font-weight:bold; background-color:#EE0000"
else if (bucket.value == 10)
style = "font-style: italic; font-weight:bold; background-color:#EEEE00"
]]>
</
ComputedStyle
>
<
SqlDefRef
>
<
GroupName
>PTA.TlvSqls</
GroupName
>
<
SqlName
>DummySql</
SqlName
>
</
SqlDefRef
>
<
SqlQuantityField
levelType
=
"Undefined"
>
<
FieldName
>quantity</
FieldName
>
</
SqlQuantityField
>
<
SqlDateField
levelType
=
"Undefined"
>
<
FieldName
>the_date</
FieldName
>
</
SqlDateField
>
</
DM
>
In the above example, we are providing different styles to the bucket containing values 1 (background color red) and 10 (background color yellow) using groovy. Please refer to
ComputedDM
for a list of parameters and an explanation of what values are bound to the groovy shell during evaluation