@using System.Globalization

<RadzenStack class="rz-p-0 rz-p-md-6 rz-p-lg-12">
    <RadzenRow>
        <RadzenColumn Size="12">
            <RadzenChart Animate="true">
                <RadzenChartTooltipOptions Shared="true" />
                <RadzenStackedLineSeries Data="@revenue2025" CategoryProperty="Quarter" Title="2025" ValueProperty="Revenue" />
                <RadzenStackedLineSeries Data="@revenue2026" CategoryProperty="Quarter" Title="2026" ValueProperty="Revenue" LineType="LineType.Dashed" />
                <RadzenCategoryAxis Padding="20">
                    <RadzenAxisCrosshair Visible="true" />
                </RadzenCategoryAxis>
                <RadzenValueAxis Formatter="@FormatAsUSD">
                    <RadzenGridLines Visible="true" />
                    <RadzenAxisTitle Text="Revenue in USD" />
                </RadzenValueAxis>
            </RadzenChart>
        </RadzenColumn>
    </RadzenRow>
</RadzenStack>

@code {
    class DataItem
    {
        public string Quarter { get; set; }
        public double Revenue { get; set; }
    }

    string FormatAsUSD(object value)
    {
        return ((double)value).ToString("C0", CultureInfo.CreateSpecificCulture("en-US"));
    }

    DataItem[] revenue2025 = new DataItem[] {
        new DataItem { Quarter = "Q1", Revenue = 234000 },
        new DataItem { Quarter = "Q2", Revenue = 284000 },
        new DataItem { Quarter = "Q3", Revenue = 274000 },
        new DataItem { Quarter = "Q4", Revenue = 294000 },
    };

    DataItem[] revenue2026 = new DataItem[] {
        new DataItem { Quarter = "Q1", Revenue = 254000 },
        new DataItem { Quarter = "Q2", Revenue = 324000 },
        new DataItem { Quarter = "Q3", Revenue = 354000 },
        new DataItem { Quarter = "Q4", Revenue = 394000 },
    };
}
