Interface IChartJsInterop
Minimal JS interop surface required by BOBCharts. Concrete implementations
live in the same package and lazy-load
_content/BlazOrbit.Charts/js/Types/Chart/ChartInterop.js.
The chart components themselves never call Microsoft.JSInterop.IJSRuntime directly; everything goes through this interface so JS-less hosts (static SSR, prerender) can plug in a no-op implementation.
public interface IChartJsInterop
Methods
ExportSvgAsPngAsync(ElementReference, string, int?, int?)
Serializes the supplied <svg> element to a PNG image and
triggers a browser download. Runs entirely client-side; the server
never sees the image bytes.
ValueTask ExportSvgAsPngAsync(ElementReference svg, string fileName, int? width = null, int? height = null)
Parameters
svgElementReferenceElement reference of the chart's
<svg>root.fileNamestringSuggested file name (without extension).
widthint?Optional explicit pixel width for the rasterized image.
heightint?Optional explicit pixel height for the rasterized image.
Returns
- ValueTask
ObserveResizeAsync(ElementReference, DotNetObjectReference<object>)
Installs a ResizeObserver on the supplied container element.
Each observed resize re-invokes OnResize(width, height) on the
caller's Microsoft.JSInterop.DotNetObjectReference<TValue>. Returns an opaque
handle that must be passed to UnobserveResizeAsync(string) to
detach the observer.
ValueTask<string> ObserveResizeAsync(ElementReference container, DotNetObjectReference<object> callbackTarget)
Parameters
containerElementReferenceElement reference of the chart's host.
callbackTargetDotNetObjectReference<object>.NET object exposing
OnResize.
Returns
- ValueTask<string>
Handle that identifies this observer registration.
UnobserveResizeAsync(string)
Removes a previously installed ResizeObserver. Idempotent: a
missing handle is a no-op.
ValueTask UnobserveResizeAsync(string handle)
Parameters
handlestringHandle previously returned by ObserveResizeAsync(ElementReference, DotNetObjectReference<object>).
Returns
- ValueTask