The Visio diagram is not showing properly or some elements are missing
There are two reasons the diagram may not be shown fully:
1. Before you save a Visio file as SVG make sure that nothing in the diagram is selected. If you save a diagram with a shape selected then the resulting SVG can be empty or only show the selected shape. You should find that you can easily open your SVG file using your browser in order to check the file.
2. SVG sanitization - SVG files uploaded to the Visio tile (How to use the Visio tile) are sanitized by Dashboard Server to prevent cross-site scripting (XSS) attacks, such as redirecting to a phishing site. If an SVG is failing to display correctly, then it is likely that certain tags are being removed by the sanitizer.
There are two ways to fix the problem of SVG sanitization:
1. Modify the original SVG
The most common source of this issue is importing Visio stencils or SVGs from third party sources. If certain tags are being removed, please replace them with alternatives if possible.
SVG tags known to cause issues are: foreignObject
and use
tags.
foreignObject
tags are often used within switch
tags. If so, they can be removed along with the switch tag and the second part of the switch tag can be used in their place. For instance,
<switch>
<foreignObject>
...
</foreignObject>
<svg>
...
</svg>
</switch>
becomes
<svg>
...
</svg>
To replace use
tags, replace them with the tag they are referencing. For instance,
<g id="123" firstAttributes="...">
...
</g>
...
<use xlink:href="#123" secondAttributes="..."/>
becomes
<g id="123" firstAttributes="...">
...
</g>
...
<g firstAttributes="..." secondAttributes="...">
...
</g>
2. Disable SVG sanitization
If you are unable to modify the original SVG then it is also possible to disable SVG sanitization. This method is only available for Dashboard Server v4.2 and above. Please be aware that disabling this feature presents a security risk and that it affects all SVGs uploaded to Visio tiles across the whole of Dashboard Server.
Please ensure that if you choose to disable SVG sanitization, users are advised to remain vigilant and must be cautious of any strange behavior on pages containing uploaded SVGs.
Disabling SVG sanitization
On the SquaredUp server, run Notepad as administrator (Start, Run, type
notepad
, and then right-click and select Run as administrator).In Notepad, open the
security.json
file from the Dashboard Server folder:...\User\Configuration\security.json
If the file doesn't exist, create it by following these steps and saving the file as
security.json
at the end.Where to find the Dashboard Server folderName of the Dashboard Server folder
The name of the Dashboard Server folder is
SquaredUpv
followed by theproduct version number
.Location of the Dashboard Server folder
The default location for the Dashboard Server folder is
C:\inetpub\wwwroot\SquaredUpv[Version Number]
, but a custom location may have been chosen during the installation.
For example, for Dashboard Server v5 the default folder location isC:\inetpub\wwwroot\SquaredUpv5
and for v4 C:\inetpub\wwwroot\SquaredUpv4
Edit the JSON file to contain the following property:
Copy{
"enable-visio-svg-sanitization": false
}- If the file already contains settings, then you will need to add a comma at the end of the previous line.
- Save the json file.
- Recycle the Dashboard Server application pool.
For more help see:
Troubleshooting the Visio tile