Forum Discussion
Dynamic bubble chart percentages
Hello,
I have dynamics bubble chart .
The code is here:
My problem is, that the "OG YTD" is a percentage value, but int chart the bubble contains a very long number, not the correct percentage.
Thank you,
Anett
Hi Anonymous ,
Try to change your measure in order to format the OG YTD measure something similar to this:
KPI = VAR kpiColor = "#00BFFF" VAR kpiBlock = "data:image/svg+xml;utf8,<svg height='400' width='400' xmlns='http://www.w3.org/2000/svg'><circle cx='200' cy='200' r='" & FORMAT ( [KPI Radius]; "###" ) & "' stroke='" & kpiColor & "' stroke-width='1' fill='" & kpiColor & "' />" & " <text x='50%' y='50%' text-anchor='middle' stroke='balck' stroke-width='2px' dy='.3em'>" & FORMAT ( [OG YTD]; "## %" ) & "</text>" & "</svg>" RETURN IF ( HASONEFILTER ( Finance[Hierarchy Level] ); kpiBlock )
6 Replies
- MFelixSuper User
Hi Anonymous ,
Try to change your measure in order to format the OG YTD measure something similar to this:
KPI = VAR kpiColor = "#00BFFF" VAR kpiBlock = "data:image/svg+xml;utf8,<svg height='400' width='400' xmlns='http://www.w3.org/2000/svg'><circle cx='200' cy='200' r='" & FORMAT ( [KPI Radius]; "###" ) & "' stroke='" & kpiColor & "' stroke-width='1' fill='" & kpiColor & "' />" & " <text x='50%' y='50%' text-anchor='middle' stroke='balck' stroke-width='2px' dy='.3em'>" & FORMAT ( [OG YTD]; "## %" ) & "</text>" & "</svg>" RETURN IF ( HASONEFILTER ( Finance[Hierarchy Level] ); kpiBlock )- AnonymousNot applicable
Hi MFelix ,
Thank you, it's working.
Can you help me with the font size too? Now the font size is tiny, but the the Visualization "Format" funkcion not effect it. I think I should make some change in the code.
Thank you,
Anett
- MFelixSuper User
Hi Anonymous ,
what is the visualizationyou are using? Some custom visualizations don't have the chance to change font size.
- v-lionel-msftCommunity Support
Hi Anonymous ,
Like MFelix said, try to add font size property to the text label.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.