@using Radzen.Blazor
@implements IDisposable

@Chart?.RenderCrosshair()
@Chart?.RenderActivePoint()

@code {
    [Parameter]
    public RadzenChart? Chart { get; set; }

    protected override void OnInitialized()
    {
        if (Chart != null)
        {
            Chart.HoverOverlay = this;
        }
    }

    internal void Refresh()
    {
        StateHasChanged();
    }

    public void Dispose()
    {
        if (Chart != null && ReferenceEquals(Chart.HoverOverlay, this))
        {
            Chart.HoverOverlay = null;
        }
    }
}
