Forum Discussion

dKayt's avatar
dKayt
Copper Contributor
Mar 13, 2024

How to set a scalable background image into my svg

Hello,

I'm formating a SharePoint List and I want to set a scalable background image to my svg.
Here is my code : 

 

 

 

 

"children": [
      {
        "elmType": "svg",
        "attributes": {
          "viewBox": "0 0 1100 300"
        },
        "style": {
          "opacity": "1",
          "stroke": "green"
        },
        "children": [
          {
            "elmType": "a",
            "attributes": {
              "href": "[$href]",
              "alt": "[$alt]",
              "target": "_blank"
            },
            "children": [
              {
                "elmType": "path",
                "attributes": {
                  "title": "[$Title]",
                  "d": "[$coords]"
                },
                "style": {
                  "fill": "red"
                },
                "customCardProps": {
                  "openOnEvent": "hover",
                  "formatter": {
                    "elmType": "div",
                    "txtContent": "[$Title]",
                    "style": {
                      "padding": "10px"
                    }
                  },
                  "isBeakVisible": true
                }
              }
            ]
          }
        ]
      }
    ]

 

 

 

Do I miss something?

Thanks, dKayt

 

No RepliesBe the first to reply

Resources