29 lines
894 B
C#
29 lines
894 B
C#
using Microsoft.AspNetCore.Components;
|
|
using Plotly.Blazor;
|
|
using Plotly.Blazor.Traces;
|
|
using Schaad.Accounting.Interfaces;
|
|
|
|
namespace Schaad.Accounting.UI.Components.Pages.Charts;
|
|
|
|
public partial class BookingTextBreakdown : ComponentBase
|
|
{
|
|
private PlotlyChart chart = null!;
|
|
private Config? config;
|
|
private Plotly.Blazor.Layout? layout;
|
|
private IList<ITrace>? data;
|
|
|
|
[Parameter, EditorRequired]
|
|
public string AccountId { get; set; } = null!;
|
|
|
|
[Inject]
|
|
private IChartService chartService { get; set; } = null!;
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
config = ChartTheme.BaseConfig();
|
|
layout = ChartTheme.BaseLayout("Nach Buchungstext");
|
|
|
|
var totals = await chartService.GetBookingTextTotalsAsync(AccountId);
|
|
data = new List<ITrace> { ChartTheme.BuildDonutTrace(ChartFormatting.FoldTail(totals)) };
|
|
}
|
|
}
|