diff --git a/GPW.CORE.UI/Components/Chart.razor b/GPW.CORE.UI/Components/Chart.razor new file mode 100644 index 0000000..cea01da --- /dev/null +++ b/GPW.CORE.UI/Components/Chart.razor @@ -0,0 +1,59 @@ +@inject IJSRuntime JSRuntime + + + +@code { + public enum ChartType + { + Pie, + Bar + } + + [Parameter] + public string Id { get; set; } = "MyChart"; + + [Parameter] + public ChartType Type { get; set; } + + [Parameter] + public string[] Data { get; set; } + + [Parameter] + public string[] BackgroundColor { get; set; } + + [Parameter] + public string[] Labels { get; set; } + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + // Here we create an anonymous type with all the options + // that need to be sent to Chart.js + var config = new + { + Type = Type.ToString().ToLower(), + Options = new + { + Responsive = true, + //Scales = new + //{ + // YAxes = new[] + // { + // new { Ticks = new { + // BeginAtZero=true + // } } + // } + //} + }, + Data = new + { + Datasets = new[] + { + new { Data = Data, BackgroundColor = BackgroundColor} + }, + Labels = Labels + } + }; + + await JSRuntime.InvokeVoidAsync("setup", Id, config); + } +} \ No newline at end of file diff --git a/GPW.CORE.UI/Components/DayCheckEditor.razor b/GPW.CORE.UI/Components/DayCheckEditor.razor new file mode 100644 index 0000000..2f8eff0 --- /dev/null +++ b/GPW.CORE.UI/Components/DayCheckEditor.razor @@ -0,0 +1,46 @@ +@using CORE.Data.DbModels +@using UI.Data + +@inject MessageService AppMServ + + + +