Hello,
I recently upgraded my project from Radzen version 5 to 7.0.5, and I encountered a JavaScript error when hovering over a column chart that uses <RadzenChartTooltip />
.
Project Setup
We're using an older project structure that includes:
_Host.cshtml
App.razor
Index.razor
In _Host.cshtml
, we render the root component with server-side render mode:
@(await Html.RenderComponentAsync<App>(RenderMode.Server, new { IPAddress = Model.IpAddress }))
And we include these scripts:
<script src="_framework/blazor.server.js" autostart="false"></script>
<script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>
<script src="js/script.js"></script>
App.razor and Layout Details
App.razor
uses the default<Router>
with<RouteView>
.- In
MainLayout.razor
, we define our layout and include:
<RadzenTooltip />
<RadzenChartTooltip />
Problem
When hovering over a column chart, this error appears in the console:
[2025-05-23T06:07:50.983Z] Error: Microsoft.JSInterop.JSException: Could not find 'Radzen.openChartTooltip' ('openChartTooltip' was undefined).
Error: Could not find 'Radzen.openChartTooltip' ('openChartTooltip' was undefined).
Uncaught (in promise) Error: Cannot send data if the connection is not in the 'Connected' State.
at on.send (blazor.server.js:1:81941)
...
at HTMLDivElement.<anonymous> (Radzen.Blazor.js:1204:18)
Chart Definition Snippet
Here's how we're defining the chart component:
<RadzenColumnSeries Data="@x" CategoryProperty="CurrencyCode" Title="x" ValueProperty="Amount">
<TooltipTemplate Context="data">
<div>
<strong>Gross Written Premium: @data.Amount.ToString("N2") @data.CurrencyCode</strong>
</div>
</TooltipTemplate>
</RadzenColumnSeries>
What We've Already Done
We’ve followed the documentation for using Radzen components with interactive server mode. Specifically:
- Added
<RadzenComponents @rendermode="InteractiveServer" />
inMainLayout
- Confirmed
Radzen.Blazor.js
is referenced in_Host.cshtml
What’s Not Working
Despite this, hovering over the chart causes the error and tooltips do not show.
Question
Is there any additional step required in version 7.0.5 to enable RadzenChartTooltip
properly?
Is it possible this is a version-related issue or a missing initialization due to how scripts are loaded?
Would really appreciate any guidance to fix this.
Thanks in advance!