skip to main content
Power BI
    • What is Power BI
    • Why Power BI
    • Customer stories
    • Data visuals
    • Security
    • Power BI Desktop
    • Power BI Pro
    • Power BI Premium
    • Power BI Mobile
    • Power BI Embedded
    • Power BI Report Server
  • Pricing
    • Azure + Power BI
    • Microsoft 365 + Power BI
    • Dynamics 365 + Power BI
      • Energy
      • Healthcare
      • Manufacturing
      • Media
      • Retail
    • For analysts
    • For IT
      • Overview
      • Embedded analytics
      • Power BI visuals
      • Automation
      • Documentation
      • Community
    • Overview
    • Find consulting services
    • Partner showcase
    • Find a partner
    • Become a partner
    • Instructor-led training
    • Getting started
      • Overview
      • Self-guided learning
      • Webinars
      • Documentation
      • Roadmap
      • Overview
      • Issues
      • Give feedback
    • Blog
    • Business intelligence topics
    • Overview
    • Forums
    • Galleries
    • Submit ideas
    • Events
    • User groups
    • Community blog
    • Register
    • ·
    • Sign in
    • ·
    • Help
    Go To
    • Microsoft Power BI Community
    • Welcome to the Community!
    • News & Announcements
    • Get Help with Power BI
    • Desktop
    • Service
    • Report Server
    • Power Query
    • Mobile Apps
    • Developer
    • DAX Commands and Tips
    • Custom Visuals Development Discussion
    • Health and Life Sciences
    • Power BI Spanish Community
    • Translated Spanish Desktop
    • Power Platform Integration - Better Together!
    • Power Platform Integrations
    • Power Platform and Dynamics 365 Integrations
    • Training and Consulting
    • Instructor Led Training
    • Galleries
    • Community Connections & How-To Videos
    • COVID-19 Data Stories Gallery
    • Themes Gallery
    • Data Stories Gallery
    • R Script Showcase
    • Webinars and Video Gallery
    • Quick Measures Gallery
    • 2021 MSBizAppsSummit Gallery
    • 2020 MSBizAppsSummit Gallery
    • 2019 MSBizAppsSummit Gallery
    • Events
    • Ideas
    • Custom Visuals Ideas
    • Issues
    • Issues
    • Events
    • Upcoming Events
    • Community Engagement
    • T-Shirt Design Challenge 2023
    • Community Blog
    • Power BI Community Blog
    • Custom Visuals Community Blog
    • Community Support
    • Community Accounts & Registration
    • Using the Community
    • Community Feedback
    cancel
    Turn on suggestions
    Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
    Showing results for 
    Search instead for 
    Did you mean: 
    • Microsoft Power BI Community
    • Galleries
    • Quick Measures Gallery
    • SVG Animation - Have a Heart

    SVG Animation - Have a Heart

    09-17-2018 19:50 PM - last edited 09-18-2018 08:39 AM

    Super User Greg_Deckler
    Super User
    3494 Views
    LinkedIn LinkedIn Facebook Facebook Twitter Twitter
    Greg_Deckler
    Super User Greg_Deckler
    Super User
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    SVG Animation - Have a Heart

    ‎09-17-2018 07:50 PM

    Again, to see the animation, you may have to download the PBIX. Three measures, Heart, HeartBeat and BeatingHeart.

     

    Heart

     

    Heart = 
    VAR __color = "Red"
    VAR __lineColor = "Black"
    VAR __lineThickness = 1
    VAR __radius = 9
    VAR __opacity = 1
    VAR __rand = RAND()
    VAR __header = "data:image/svg+xml;utf8," &
                  "<svg 
                    xmlns:dc='http://purl.org/dc/elements/1.1/'
                    xmlns:cc='http://creativecommons.org/ns#'
                    xmlns:svg='http://www.w3.org/2000/svg'
                    xmlns='http://www.w3.org/2000/svg'
                    viewBox='0 0 150 150' version='1.1'>"
    VAR __footer = "</svg>"
    VAR __shapeTextCircle = "
    <g>
        <circle cx='30' cy='50' r='30' stroke='Red' fill='Red'/>
        <circle cx='70' cy='50' r='30' stroke='Red' fill='Red'/>
        <path stroke-width='2' stroke='Red' fill='Red' d='M7 70, L50 112, L93 70'/>
        <!-- <path stroke-width='2' stroke='Red' fill='Red' d='M60,30 a30,30 0 0,1 0,60 L0,90 0,30 a30,30 0 0,1 60,0' /> -->     </g>
    "
    RETURN IF([Flag],"",__header & __shapeTextCircle & __footer)

     

     

    HeartBeat

     

    HeartBeat = 
    VAR __color = "Red"
    VAR __lineColor = "Black"
    VAR __lineThickness = 1
    VAR __radius = 9
    VAR __opacity = 1
    VAR __rand = RAND()
    VAR __header = "data&colon;image/svg+xml;utf8," &
                  "<svg 
                    xmlns:dc='http://purl.org/dc/elements/1.1/'
                    xmlns:cc='http://creativecommons.org/ns#'
                    xmlns:svg='http://www.w3.org/2000/svg'
                    xmlns='http://www.w3.org/2000/svg'
                    viewBox='0 0 20 10' version='1.1'>"
    VAR __footer = "</svg>"
    VAR __shapeText = "
        <path stroke-width='.5' stroke='Red' fill='none' d='M-13 7, L-10 7, L-9 1, L-8 9, L-7 7, L-4 7, L-3 1, L-2 9, L-1 7, L2 7, L3 1, L4 9, L5 7, L8 7, L9 1, L10 9, L11 7, L14 7, L15 1, L16 9, L17 7, L20 7' stroke-dasharray='120' stroke-dashoffset='0'>
        <animateTransform 
               attributeName='transform' 
               attributeType='XML'
               type='translate'
               from='0 0'
               to='12 0' 
               dur='5s'
               begin='0s'
               repeatCount='indefinite'
               />
        </path>
    "
    VAR __shapeTextFlat = "
        <path stroke-width='.5' stroke='Red' fill='none' d='M0 7, L20 7'/>
    "
    RETURN IF([Flag],__header & __shapeTextFlat & __footer,__header & __shapeText & __footer)
    

     

     

     BeatingHeart

     

     

    BeatingHeart = 
    VAR __color = "Red"
    VAR __lineColor = "Black"
    VAR __lineThickness = 1
    VAR __radius = 9
    VAR __opacity = 1
    VAR __rand = RAND()
    VAR __header = "data&colon;image/svg+xml;utf8," &
                  "<svg 
                    xmlns:dc='http://purl.org/dc/elements/1.1/'
                    xmlns:cc='http://creativecommons.org/ns#'
                    xmlns:svg='http://www.w3.org/2000/svg'
                    xmlns='http://www.w3.org/2000/svg'
                    viewBox='0 0 150 150' version='1.1'>"
    VAR __footer = "</svg>"
    VAR __shapeTextCircle = "
    <g>
        <circle cx='30' cy='50' r='30' stroke='Red' fill='Red'/>
        <circle cx='70' cy='50' r='30' stroke='Red' fill='Red'/>
        <path stroke-width='2' stroke='Red' fill='Red' d='M7 70, L50 112, L93 70'/>
        <animateTransform 
               attributeName='transform' 
               attributeType='XML'
               type='scale'
               from='1'
               to='1.1' 
               dur='1s'
               begin='0s'
               repeatCount='indefinite'
               />
        </g>
    "
    RETURN IF([Flag],"",__header & __shapeTextCircle & __footer)

     

     

    eyJrIjoiNjAyNTM2NzMtYjZiMC00MTAyLThjOTUtMDM5YzY5Zjg0ODZkIiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN9


    @ me in replies or I'll lose your thread!!!
    Instead of a Kudo, please vote for this idea
    Become an expert!: Enterprise DNA
    External Tools: MSHGQM
    YouTube Channel!: Microsoft Hates Greg
    Latest book!:
    Mastering Power BI 2nd Edition

    DAX is easy, CALCULATE makes DAX hard...
    Preview file
    363 KB
    Have a Heart.pbix
    Labels:
    • Labels:
    • Other
    Message 1 of 1
    3,494 Views
    3
    Reply
    • All forum topics
    • Previous Topic
    • Next Topic

    Power Platform

    • Overview
    • Power BI
    • Power Apps
    • Power Pages
    • Power Automate
    • Power Virtual Agents

    • Sign in
    • Sign up

    Browse

    • Solutions
    • Partners
    • Consulting Services

    Downloads

    • Power BI Desktop
    • Power BI Mobile
    • Power BI Report Server
    • See all downloads

    Learn

    • Guided learning
    • Documentation
    • Support
    • Community
    • Give feedback
    • Webinars
    • Developers
    • Blog
    • Newsletter

    © 2023 Microsoft

    Follow Power BI

    • Privacy & cookies
    • Manage cookies
    • Terms of use
    • Trademarks
    Consumer Privacy Act (CCPA) Opt-Out Icon Your Privacy Choices