Forum Discussion
Checkmark emoji on different platforms
- 1 year ago
Hi duddys
Is your checkmark using UNICHAR to render it? These characters are rendered differently by different browsers. You can use SVG in icon conditional formatting for a greater control on colors.
SVG Checkmark = VAR _value = CALCULATE ( SUM ( 'Table'[Value] ) ) VAR _threshold = 1500 VAR _test = _value > _threshold VAR width = IF ( _test, 80, 0 ) VAR height = IF ( _test, 80, 0 ) VAR stroke1 = IF ( _test, 5, 0 ) --increase to make the border thicker VAR stroke2 = IF ( _test, 10, 0 ) -- increase to make the checkmark thicker VAR __Prefix = "data:image/svg+xml;utf8," --note: after hitting reply this line will probably return a different value so refer to the screenshot VAR SVG = "<svg width='100' height='100' xmlns='http://www.w3.org/2000/svg'> <!-- Background square --> <rect x='10' y='10' width='" & width & "' height='" & height & "' fill='limegreen' stroke='darkgreen' stroke-width='" & stroke1 & "' /> <!-- Checkmark --> <path d='M30 50 L45 65 L70 35' fill='none' stroke='white' stroke-width='" & stroke2 & "' stroke-linecap='round' stroke-linejoin='round' /> </svg>" RETURN __Prefix & SVGPlease note that based on testing, SVG as icons will not be rendered if hexadecimal values are used thus the limegreeen and darkgreen colors. Also you need to change the dimension of the SVG elements to 0 if you don't want to show them as, if for example, if i simply use IF(_test, _Prefix & SVG), those do not meet the _test condition will still return in Firefox a missing image icon instead of nothing.
Please see sample pbix.
Hi duddys
Is your checkmark using UNICHAR to render it? These characters are rendered differently by different browsers. You can use SVG in icon conditional formatting for a greater control on colors.
SVG Checkmark =
VAR _value =
CALCULATE ( SUM ( 'Table'[Value] ) )
VAR _threshold = 1500
VAR _test = _value > _threshold
VAR width =
IF ( _test, 80, 0 )
VAR height =
IF ( _test, 80, 0 )
VAR stroke1 =
IF ( _test, 5, 0 ) --increase to make the border thicker
VAR stroke2 =
IF ( _test, 10, 0 ) -- increase to make the checkmark thicker
VAR __Prefix = "data:image/svg+xml;utf8," --note: after hitting reply this line will probably return a different value so refer to the screenshot
VAR SVG = "<svg width='100' height='100' xmlns='http://www.w3.org/2000/svg'>
<!-- Background square -->
<rect x='10' y='10' width='" & width & "' height='" & height & "'
fill='limegreen' stroke='darkgreen' stroke-width='" & stroke1 & "' />
<!-- Checkmark -->
<path d='M30 50 L45 65 L70 35'
fill='none' stroke='white' stroke-width='" & stroke2 & "' stroke-linecap='round' stroke-linejoin='round' />
</svg>"
RETURN
__Prefix & SVG
Please note that based on testing, SVG as icons will not be rendered if hexadecimal values are used thus the limegreeen and darkgreen colors. Also you need to change the dimension of the SVG elements to 0 if you don't want to show them as, if for example, if i simply use IF(_test, _Prefix & SVG), those do not meet the _test condition will still return in Firefox a missing image icon instead of nothing.
Please see sample pbix.