using ApexCharts; using Biskilog_Accounting.Shared.CustomModels; using Microsoft.AspNetCore.Components; using Radzen.Blazor.Rendering; using Legend = ApexCharts.Legend; namespace Biskilog_Accounting.Client.Pages.Dashboard.Elements { public partial class MostPurchasedElement { [Parameter] public IEnumerable MostPurchasedItems { get; set; } = new List(); [Parameter] public bool IsLoading { get; set; } = true; private ApexChartOptions m_options { get; set; } = new(); private IEnumerable m_items { get; set; } = new List(); protected override void OnInitialized() { m_options.Legend = new Legend() { Show = false, }; } protected override void OnParametersSet() { m_items = MostPurchasedItems.OrderByDescending(t => t.NbrTimesSold); IsLoading = false; base.OnParametersSet(); } } }