You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.1 KiB
33 lines
1.1 KiB
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<MostPurchasedItem> MostPurchasedItems { get; set; } = new List<MostPurchasedItem>();
|
|
|
|
[Parameter]
|
|
public bool IsLoading { get; set; } = true;
|
|
private ApexChartOptions<MostPurchasedItem> m_options { get; set; } = new();
|
|
private IEnumerable<MostPurchasedItem> m_items { get; set; } = new List<MostPurchasedItem>();
|
|
|
|
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();
|
|
}
|
|
}
|
|
}
|
|
|