return { register: function (containerId, dotNetRef) { // Retry until the Kendo chart widget is ready (rendered async by Blazor) var attempts = 0; function tryBind() { var chart = getChartInstance(containerId); if (chart) { var lastMin = 0, lastMax = 0; var timer = null; var container = document.getElementById(containerId);
container.addEventListener('mouseup', function () { if (timer) clearTimeout(timer); timer = setTimeout(function () { var range = readDateAxisRange(chart); if (range && !isNaN(range.min) && !isNaN(range.max)) { var minT = range.min.getTime(), maxT = range.max.getTime(); if (minT !== lastMin || maxT !== lastMax) { lastMin = minT; lastMax = maxT; dotNetRef.invokeMethodAsync('OnZoomChanged', formatDate(range.min), formatDate(range.max)); } } }, 150); });
[JSInvokable] public async Task OnZoomChanged(string minStr, string maxStr) { if (DateTime.TryParse(minStr, out var min) && DateTime.TryParse(maxStr, out var max)) await OnZoomRangeChanged.InvokeAsync((min, max)); }
public async ValueTask DisposeAsync() { _dotNetRef?.Dispose(); } }
3. Host page — add the script reference after telerik-blazor.js:
How it works: Left-mouse drag selects a zoom region. On mouseup, the JS reads the new axis range from chartInstance._plotArea.axes and calls back into Blazor. The parent page receives the new min/max via OnZoomRangeChanged and can use it to synchronize other charts or display the range.
Important: This relies on undocumented internals (TelerikBlazor.getComponentInstance, chartInstance._plotArea). Tested with v13.0.0 — may need adjustment after major Telerik updates.
Ilan
Posted on:18 Feb 2026 19:58
Thank you very much for the update! Can you please provide a working example?
Peter
Posted on:18 Feb 2026 19:52
Workaround: Reading zoom/pan range via internal API (Telerik.UI.for.Blazor 13.0.0)
While waiting for official event support, we implemented a JavaScript-based workaround that reads the zoomed axis range from the chart's internal rendering objects. This allows synchronizing zoom across multiple charts on the same page (e.g. one chart per axle position, all sharing the same X-axis time range).
Approach:
1. Wrap each <TelerikChart> in a <div id="@uniqueId">. 2. Enable zoom: <ChartZoomableSelection Enabled="true" Lock="ChartAxisLock.Y" /> 3. In JavaScript, access the chart instance via: var el = document.getElementById(chartId).querySelector('.k-chart'); var dataId = el.dataset.id; var wrapper = TelerikBlazor.getComponentInstance(dataId); var chart = wrapper.chartInstance; 4. Read the current axis range after zoom completes: var axes = chart._plotArea.axes; for (var i = 0; i < axes.length; i++) { if (axes[i].options.type === 'date') { var range = axes[i].range(); // { min, max } } } 5. Detect zoom completion via a DOM mouseup event listener on the chart container (with 150ms debounce), then call back into Blazor via DotNetObjectReference.invokeMethodAsync().
Caveats:
- This depends on undocumented internals (TelerikBlazor.getComponentInstance, chartInstance._plotArea.axes). It works with v13.0.0 but may break in future major versions. - There is no reliable internal event for zoom/pan completion — mouseup on the container is the most practical trigger. - We added runtime version checks that log console warnings if the Telerik version changes.
A proper Blazor event (e.g. OnZoomEnd / OnPanEnd with axis range data) would eliminate this fragile dependency entirely.