using ApexCharts ;
using Biskilog_Accounting.Shared.CustomModels ;
using Microsoft.AspNetCore.Components ;
using Microsoft.Extensions.Options ;
namespace Biskilog_Accounting.Client.Pages.Dashboard.Elements
{
public partial class ChartElement
{
[Parameter]
public bool IsLoading { get ; set ; }
[Parameter]
public string Title { get ; set ; } = string . Empty ;
[Parameter]
public string SubTitle { get ; set ; } = string . Empty ;
[Parameter]
public List < WeeklySaleItem > Series { get ; set ; } = new List < WeeklySaleItem > ( ) ;
[Parameter]
public IEnumerable < WeeklyCategorySummary > CategorySummary { get ; set ; } = Enumerable . Empty < WeeklyCategorySummary > ( ) ;
private ApexChartOptions < WeeklySaleItem > m_options ;
private ApexChartOptions < WeeklyCategorySummary > options ;
protected override void OnParametersSet ( )
{
m_options = new ApexChartOptions < WeeklySaleItem >
{
PlotOptions = new PlotOptions
{
Bar = new PlotOptionsBar
{
ColumnWidth = "20" ,
}
} ,
Colors = new List < string > { "#11726d" } ,
Yaxis = new List < YAxis >
{
new YAxis
{
Labels = new YAxisLabels
{
Formatter = @ "function (value, index, w) {
return Number ( value ) . toLocaleString ( ) ; } "
}
}
} ,
} ;
options = new ApexChartOptions < WeeklyCategorySummary >
{
Chart = new Chart
{
Height = 4 0 0 ,
} ,
Colors = new List < string >
{
"#11726d" , "#54ff00" , "#003445" , "#e69138" , "#a2896d" ,
"#b13a2c" , "#b0cba8" , "#e4e1da" , "#696cff" , "#03c3ec"
} ,
Fill = new Fill
{
Type = new List < FillType > { FillType . Gradient , FillType . Gradient } ,
Gradient = new FillGradient
{
ShadeIntensity = 1 ,
OpacityFrom = 0.2 ,
OpacityTo = 0.9 ,
}
} ,
Yaxis = new List < YAxis >
{
new YAxis
{
Labels = new YAxisLabels
{
Formatter = @ "function (value, index, w) {
return Number ( value ) . toLocaleString ( ) ; } "
}
}
} ,
Legend = new Legend
{
Position = LegendPosition . Bottom ,
}
} ;
base . OnParametersSet ( ) ;
}
}
}