New source control repo for Biskilog POS - secure hub to store & manage source code. Streamlines dev process, tracks changes, & improves collaboration. Ensures reliable software.
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.

76 lines
2.5 KiB

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 = new ApexChartOptions<WeeklyCategorySummary>();
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.Colors = new List<string> { "#11726d", "#096a71", "#003445", "#e69138" };
options.Fill = new Fill
{
Type = new List<FillType> { FillType.Gradient, FillType.Gradient },
Gradient = new FillGradient
{
ShadeIntensity = 1,
OpacityFrom = 0.2,
OpacityTo = 0.9,
}
};
options.Yaxis = new List<YAxis>
{
new YAxis
{
Labels = new YAxisLabels
{
Formatter = @"function (value, index, w) {
return Number(value).toLocaleString();}"
}
}
};
base.OnParametersSet();
}
}
}