@page "/chart/doughnut"
@inject IStringLocalizer<Doughnut> Localizer

<DemoBlock Title="@Localizer["DoughnutNormalTitle"]"
           Introduction="@Localizer["DoughnutNormalIntro"]"
           Name="Normal">
    <Chart ChartType="ChartType.Doughnut" Angle="@Angle" OnInitAsync="@OnInit" OnAfterInitAsync="@OnAfterInit" OnAfterUpdateAsync="@OnAfterUpdate" @ref="DoughnutChart" class="pie" />
    <div class="text-center mt-2 chart">
        <div class="btn-group">
            <button class="btn btn-primary" @onclick="e => Utility.RandomData(DoughnutChart)"><i class="fa-brands fa-slack"></i><span>@Localizer["DoughnutNormalRandomData"]</span></button>
            <button class="btn btn-primary" @onclick="OnReloadChart"><i class="fa-solid fa-chart-column"></i><span>@Localizer["DoughnutNormalReload"]</span></button>
            <button class="btn btn-primary" @onclick="e => Utility.AddDataSet(DoughnutChart, ref DoughnutDatasetCount)"><i class="fa-solid fa-circle-plus"></i><span>@Localizer["DoughnutNormalAddDataset"]</span></button>
            <button class="btn btn-primary" @onclick="e => Utility.RemoveDataSet(DoughnutChart, ref DoughnutDatasetCount)"><i class="fa-solid fa-circle-minus"></i><span>@Localizer["DoughnutNormalRemoveDataset"]</span></button>
            <button class="btn btn-primary" @onclick="e => Utility.AddData(DoughnutChart, ref DoughnutDataCount)"><i class="fa-solid fa-plus"></i><span>@Localizer["DoughnutNormalAddingData"]</span></button>
            <button class="btn btn-primary" @onclick="e => Utility.RemoveData(DoughnutChart, ref DoughnutDataCount)"><i class="fa-solid fa-minus"></i><span>@Localizer["DoughnutNormalRemoveData"]</span></button>
            <button class="btn btn-primary" @onclick="@ToggleCircle"><i class="fa-regular fa-circle-notch"></i><span>@Localizer["DoughnutNormalHalf"]</span></button>
        </div>
    </div>
    <ConsoleLogger @ref="Logger" />
</DemoBlock> 

<DemoBlock Title="@Localizer["DoughnutAspectRatioTitle"]"
           Introduction="@Localizer["DoughnutAspectRatioIntro"]"
           Name="AspectRatio">
    <Chart ChartType="ChartType.Doughnut" OnInitAsync="@OnInit" Height="400px" Width="400px" />
</DemoBlock>

