Forum Discussion
How to make a Card Text Blink
- 2 years ago
HI Anonymous
For flashing text, you could construct HTML or SVG and use the HTML Content (Lite) custom visual.
I have attached a small example where I defined the content for the "card" as an SVG.
The measure is as follows:
Profit $ SVG = VAR MeasureValue = [Profit $] VAR MeasureSign = SIGN ( MeasureValue ) VAR MeasureFormatted = FORMAT ( MeasureValue, "#,##0;(#,##);-" ) VAR TextColour = SWITCH ( MeasureSign, -1, "red", "black" ) VAR AnimationTag = SWITCH ( MeasureSign, -1, "<animate attributeName='opacity' values='1;0;1' dur='1s' repeatCount='indefinite' />", "" ) VAR SVG_String = "<svg viewBox='0 0 300 80' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='xMidYMid meet'> <text x='50%' y='50%' font-family='DIN' font-size='50' fill='" & TextColour & "' dominant-baseline='middle' text-anchor='middle'>" & AnimationTag & MeasureFormatted & "</text></svg>" RETURN SVG_StringThe formatting would likely need to be adjusted to meet your needs but this should be a start at least 🙂
Regards
hello Anonymous
i have never seen a blinking or flashing color in conditional formating since it is color or icon selections.
But the others might know.
Thank you.
HI Anonymous
For flashing text, you could construct HTML or SVG and use the HTML Content (Lite) custom visual.
I have attached a small example where I defined the content for the "card" as an SVG.
The measure is as follows:
Profit $ SVG =
VAR MeasureValue = [Profit $]
VAR MeasureSign = SIGN ( MeasureValue )
VAR MeasureFormatted =
FORMAT ( MeasureValue, "#,##0;(#,##);-" )
VAR TextColour =
SWITCH (
MeasureSign,
-1,
"red",
"black"
)
VAR AnimationTag =
SWITCH (
MeasureSign,
-1,
"<animate attributeName='opacity' values='1;0;1' dur='1s' repeatCount='indefinite' />",
""
)
VAR SVG_String =
"<svg viewBox='0 0 300 80' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='xMidYMid meet'>
<text x='50%' y='50%' font-family='DIN' font-size='50' fill='" & TextColour & "' dominant-baseline='middle' text-anchor='middle'>"
& AnimationTag & MeasureFormatted & "</text></svg>"
RETURN
SVG_String
The formatting would likely need to be adjusted to meet your needs but this should be a start at least 🙂
Regards