0

For a mobile app (built with the Ionic framework), I want to use a diagram I created with Google Spreadsheets. Following the steps described on this page I managed to save the diagram as an .svg file by copying the svg code shown in Chrome Dev Tools.

I then used the .svg file in the src attribute of the img tag, as described in this question.

Unfortunately, this does not show the image. Does the svg code of Google contain some code which doesn't make it render? Here is the link to the svg code.

Community
  • 1
  • 1
Bert Carremans
  • 1,623
  • 4
  • 23
  • 47

1 Answers1

1

Standalone external SVG must have a namespace declaration. They are XML files and the browser needs to know what type of XML they are (in this case an SVG).

You'll need to alter the first line of the SVG file to:

<svg xmlns="http://www.w3.org/2000/svg" width="786" height="459" overflow="hidden">

Try that.

Paul LeBeau
  • 97,474
  • 9
  • 154
  • 181