<RadzenStack class="rz-p-0 rz-p-md-6 rz-p-lg-12">
    <RadzenCard Variant="Variant.Outlined">
        <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" Wrap="FlexWrap.Wrap">
        <RadzenStack Gap="0.25rem">
            <RadzenText TextStyle="TextStyle.Caption">Legend Position</RadzenText>
            <RadzenSelectBar @bind-Value="legendPosition" TValue="LegendPosition" Size="ButtonSize.Small" Change="@(() => StateHasChanged())">
                <Items>
                    <RadzenSelectBarItem Text="Right" Value="LegendPosition.Right" />
                    <RadzenSelectBarItem Text="Left" Value="LegendPosition.Left" />
                    <RadzenSelectBarItem Text="Top" Value="LegendPosition.Top" />
                    <RadzenSelectBarItem Text="Bottom" Value="LegendPosition.Bottom" />
                </Items>
            </RadzenSelectBar>
        </RadzenStack>
        <RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Center">
            <RadzenSwitch @bind-Value="legendVisible" Name="legendVisible" Change="@(() => StateHasChanged())" />
            <RadzenLabel Text="Show Legend" Component="legendVisible" />
        </RadzenStack>
        </RadzenStack>
    </RadzenCard>

    <RadzenSpiderChart Style="width: 100%; height: 500px;">
    <RadzenSpiderLegend Position="@legendPosition" Visible="@legendVisible" />
    <RadzenSpiderSeries TItem="SkillData"
                        Data="@aliceData"
                        CategoryProperty="@nameof(SkillData.Skill)"
                        ValueProperty="@nameof(SkillData.Score)"
                        Title="Alice" />
    <RadzenSpiderSeries TItem="SkillData"
                        Data="@bobData"
                        CategoryProperty="@nameof(SkillData.Skill)"
                        ValueProperty="@nameof(SkillData.Score)"
                        Title="Bob" />
    </RadzenSpiderChart>
</RadzenStack>

@code {
    LegendPosition legendPosition = LegendPosition.Right;
    bool legendVisible = true;

    class SkillData
    {
        public string Skill { get; set; }
        public double Score { get; set; }
    }

    IEnumerable<SkillData> aliceData = new SkillData[]
    {
        new SkillData { Skill = "Communication", Score = 90 },
        new SkillData { Skill = "Problem Solving", Score = 85 },
        new SkillData { Skill = "Teamwork", Score = 92 },
        new SkillData { Skill = "Leadership", Score = 78 },
        new SkillData { Skill = "Creativity", Score = 88 },
    };

    IEnumerable<SkillData> bobData = new SkillData[]
    {
        new SkillData { Skill = "Communication", Score = 75 },
        new SkillData { Skill = "Problem Solving", Score = 92 },
        new SkillData { Skill = "Teamwork", Score = 80 },
        new SkillData { Skill = "Leadership", Score = 88 },
        new SkillData { Skill = "Creativity", Score = 70 },
    };
}
