@namespace Radzen.Blazor.Rendering
@using Radzen.Blazor

@if (Chart?.Legend?.Visible == true)
{
    <div class="@Class">
        <div class="rz-legend-items">
        @if (Chart?.Series != null)
        {
            @foreach (var series in Chart.Series)
            {
                @series.RenderLegendItem()
            }
        }
        </div>
    </div>
}

@code {
    [CascadingParameter]
    public RadzenSpiderChart? Chart { get; set; }

    string Class => ClassList.Create("rz-spider-legend")
        .Add($"rz-spider-legend-{Chart?.Legend?.Position}".ToLowerInvariant())
        .ToString();
}


