Reports.JS: gauge with a Hyperlink is clipped to half its width in HTML export and StiViewer

Stimulsoft Reports.JS discussion
Post Reply
iceman
Posts: 4
Joined: Thu Sep 24, 2026 7:55 am

Reports.JS: gauge with a Hyperlink is clipped to half its width in HTML export and StiViewer

Post by iceman »

Product / version: Stimulsoft Reports.JS 2026.3.4 and 2026.4.1 (npm `stimulsoft-reports-js`). Tested in Edge/Chromium.

Description

When a gauge component has a Hyperlink set, the HTML output of Reports.JS draws only the left half of the gauge. The same gauge without a hyperlink renders fully. It happens in `StiHtmlExportService.exportHtml` and in `StiViewer`.

Steps to reproduce

1. Load the attached `GaugeHyperlinkRepro.mrt`. It has two identical radial gauges; the left one has `Hyperlink = https://www.stimulsoft.com`, the right one has no hyperlink.
2. Render it and export to HTML with default settings (`repro.html`), or show it in `StiViewer` (`viewer.html`).

Actual result: the left gauge is cut off at its centre (screenshot `result-v4.png`).
Expected result: both gauges are fully visible, as in the .NET HTML export of the same report.

Analysis

For a component with a hyperlink, the exported markup is:

Code: Select all

<div class="s2d65704e" style="left:27.83pt;top:27.83pt;width:337.55pt;height:281.17pt;">
  <svg ... height="377.95" width="453.54">...</svg>
  <a style="display:block;width:337.55pt;height:281.17pt;text-decoration:none;" href="https://www.stimulsoft.com"></a>
</div>
<!-- .s2d65704e { ...; display: flex; align-items: flex-start; justify-content: flex-start; position: absolute; overflow: hidden; } -->
The empty `<a>` with the full component size is placed **next to** the `<svg>` in a `display:flex` container, not around it or on top of it. The default `flex-shrink: 1` shrinks the SVG to about half its width (453.54 to 226 px in our measurement), and `overflow:hidden` clips the rest. The link area also ends up beside the gauge instead of on it.

Adding `svg { flex-shrink: 0 }` shows the full gauge, which confirms the cause. A proper fix would be to wrap the SVG in the `<a>`, or to position the `<a>` absolutely over the component.

Attachments: `GaugeHyperlinkRepro.mrt`, `repro.html`, `viewer.html`, `result-v3.png` (2026.3.4), `result-v4.png` (2026.4.1).
Attachments
repro.7z
(62.04 KiB) Downloaded 17 times
Lech Kulikowski
Posts: 7884
Joined: Tue Mar 20, 2018 5:34 am

Re: Reports.JS: gauge with a Hyperlink is clipped to half its width in HTML export and StiViewer

Post by Lech Kulikowski »

Hello iceman,

Thank you for the detailed report and the repro files.
We have reproduced the issue. We will fix this and let you know as soon as the fix is available.

Thank you.
#21590
Post Reply