diff --git a/DeBankUI/Client/Program.cs b/DeBankUI/Client/Program.cs index 70e8f11..8f6e727 100644 --- a/DeBankUI/Client/Program.cs +++ b/DeBankUI/Client/Program.cs @@ -15,6 +15,7 @@ public static async Task Main(string[] args) builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); builder.Services.AddMudServices(); + builder.Services.AddBlazorDownloadFile(); await builder.Build().RunAsync(); } diff --git a/DeBankUI/Components/BaseChartComponent.cs b/DeBankUI/Components/BaseChartComponent.cs index 5c91c47..6bb52e4 100644 --- a/DeBankUI/Components/BaseChartComponent.cs +++ b/DeBankUI/Components/BaseChartComponent.cs @@ -1,12 +1,23 @@ -using Microsoft.AspNetCore.Components; +using LiveChartsCore.SkiaSharpView; +using LiveChartsCore; +using Microsoft.AspNetCore.Components; +using LiveChartsCore.SkiaSharpView.Painting; +using DeBankUI.Utils; namespace DeBankUI.Components { - public class BaseChartComponent : ComponentBase + public abstract class BaseChartComponent : ComponentBase { - public void DownloadChartData() + public ISeries[] Series { get; set; } + public Axis[] YAxes { get; set; } + public Axis[] XAxes { get; set; } + + public DrawMarginFrame DrawMarginFrame => new() { + Fill = new SolidColorPaint(Colors.ChartBackground), + Stroke = new SolidColorPaint(Colors.ChartBorder, 2) + }; - } + public abstract byte[] DownloadChartData(); } } diff --git a/DeBankUI/DeBankUI.csproj b/DeBankUI/DeBankUI.csproj index 27f3489..622dea6 100644 --- a/DeBankUI/DeBankUI.csproj +++ b/DeBankUI/DeBankUI.csproj @@ -7,6 +7,8 @@ + + diff --git a/DeBankUI/Pages/Michal/DeBankUsersPage.razor b/DeBankUI/Pages/Michal/DeBankUsersPage.razor index 2974059..ab11a25 100644 --- a/DeBankUI/Pages/Michal/DeBankUsersPage.razor +++ b/DeBankUI/Pages/Michal/DeBankUsersPage.razor @@ -15,12 +15,12 @@ - + - Get data + Get data @@ -34,12 +34,12 @@ - + - Get data + Get data diff --git a/DeBankUI/Pages/Michal/DeBankUsersPage.razor.cs b/DeBankUI/Pages/Michal/DeBankUsersPage.razor.cs index dc2609c..e2727d8 100644 --- a/DeBankUI/Pages/Michal/DeBankUsersPage.razor.cs +++ b/DeBankUI/Pages/Michal/DeBankUsersPage.razor.cs @@ -7,14 +7,24 @@ using SkiaSharp; using DeBankUI.Utils; using DeBankUI.Components; +using Blazor.DownloadFileFast.Interfaces; +using Microsoft.AspNetCore.Components; +using DeBankUI.Shared.Michal; namespace DeBankUI.Pages.Michal { public partial class DeBankUsersPage { - public void DownloadChartData() - { + [Inject] + public IBlazorDownloadFileService BlazorDownloadFileService { get; set; } + + private Web3RegistrationsChart web3RegistrationsChart; + private OfficialProfileRegistrationsChart officialProfileRegistrationsChart; + public async Task DownloadChartData(BaseChartComponent baseComponent, string title) + { + var data = baseComponent.DownloadChartData(); + await BlazorDownloadFileService.DownloadFileAsync(title, data); } } } diff --git a/DeBankUI/Pages/Michal/LuckyDrawsPage.razor b/DeBankUI/Pages/Michal/LuckyDrawsPage.razor index 426fa76..bdd67c9 100644 --- a/DeBankUI/Pages/Michal/LuckyDrawsPage.razor +++ b/DeBankUI/Pages/Michal/LuckyDrawsPage.razor @@ -13,12 +13,12 @@ - + - Get data + Get data @@ -32,12 +32,12 @@ - + - Get data + Get data @@ -51,12 +51,12 @@ - + - Get data + Get data @@ -70,12 +70,12 @@ - + - Get data + Get data diff --git a/DeBankUI/Pages/Michal/LuckyDrawsPage.razor.cs b/DeBankUI/Pages/Michal/LuckyDrawsPage.razor.cs index 8836bf3..fa27e06 100644 --- a/DeBankUI/Pages/Michal/LuckyDrawsPage.razor.cs +++ b/DeBankUI/Pages/Michal/LuckyDrawsPage.razor.cs @@ -7,14 +7,26 @@ using SkiaSharp; using DeBankUI.Utils; using DeBankUI.Components; +using Blazor.DownloadFileFast.Interfaces; +using Microsoft.AspNetCore.Components; +using DeBankUI.Shared.Michal; namespace DeBankUI.Pages.Michal { public partial class LuckyDrawsPage { - public void DownloadChartData() - { + [Inject] + public IBlazorDownloadFileService BlazorDownloadFileService { get; set; } + + private LuckyDrawsTotalChart luckyDrawsTotalChart; + private LuckyDrawsDailyChart luckyDrawsDailyChart; + private LuckyDrawsHistogram luckyDrawsHistogram; + private LuckyDrawsWinnersHistogram luckyDrawsWinnersHistogram; + public async Task DownloadChartData(BaseChartComponent baseComponent, string title) + { + var data = baseComponent.DownloadChartData(); + await BlazorDownloadFileService.DownloadFileAsync(title, data); } } } diff --git a/DeBankUI/Pages/Michal/RewardPoolsPage.razor b/DeBankUI/Pages/Michal/RewardPoolsPage.razor index 62973c5..03ea9b4 100644 --- a/DeBankUI/Pages/Michal/RewardPoolsPage.razor +++ b/DeBankUI/Pages/Michal/RewardPoolsPage.razor @@ -1,7 +1,6 @@ @using DeBankUI.Components; @using LiveChartsCore.SkiaSharpView.Blazor @page "/michal/reward-pools" -@inherits BaseChartComponent @@ -14,12 +13,12 @@ - + - Get data + Get data @@ -33,12 +32,12 @@ - + - Get data + Get data @@ -52,12 +51,12 @@ - + - Get data + Get data @@ -71,12 +70,12 @@ - + - Get data + Get data diff --git a/DeBankUI/Pages/Michal/RewardPoolsPage.razor.cs b/DeBankUI/Pages/Michal/RewardPoolsPage.razor.cs index caa3cf4..2cc66a1 100644 --- a/DeBankUI/Pages/Michal/RewardPoolsPage.razor.cs +++ b/DeBankUI/Pages/Michal/RewardPoolsPage.razor.cs @@ -7,14 +7,24 @@ using SkiaSharp; using DeBankUI.Utils; using DeBankUI.Components; +using Blazor.DownloadFileFast.Interfaces; +using Microsoft.AspNetCore.Components; +using DeBankUI.Shared.Michal; namespace DeBankUI.Pages.Michal { public partial class RewardPoolsPage { - public void DownloadChartData() + [Inject] + public IBlazorDownloadFileService BlazorDownloadFileService { get; set; } + private RewardPoolsTotalChart rewardPoolsTotalChart; + private RewardPoolsDailyChart rewardPoolsDailyChart; + private RewardPoolsHistogram rewardPoolsHistogram; + private RewardPoolsEarnersHistogram rewardPoolsEarnersHistogram; + public async Task DownloadChartData(BaseChartComponent baseComponent, string title) { - + var data = baseComponent.DownloadChartData(); + await BlazorDownloadFileService.DownloadFileAsync(title, data); } } } diff --git a/DeBankUI/Pages/Michal/StreamActivityPage.razor b/DeBankUI/Pages/Michal/StreamActivityPage.razor index fabf11b..7686da6 100644 --- a/DeBankUI/Pages/Michal/StreamActivityPage.razor +++ b/DeBankUI/Pages/Michal/StreamActivityPage.razor @@ -13,12 +13,12 @@ - + - Get data + Get data @@ -32,12 +32,12 @@ - + - Get data + Get data @@ -51,12 +51,12 @@ - + - Get data + Get data diff --git a/DeBankUI/Pages/Michal/StreamActivityPage.razor.cs b/DeBankUI/Pages/Michal/StreamActivityPage.razor.cs index 112576b..79e5e66 100644 --- a/DeBankUI/Pages/Michal/StreamActivityPage.razor.cs +++ b/DeBankUI/Pages/Michal/StreamActivityPage.razor.cs @@ -7,14 +7,24 @@ using SkiaSharp; using DeBankUI.Utils; using DeBankUI.Components; +using Blazor.DownloadFileFast.Interfaces; +using Microsoft.AspNetCore.Components; +using DeBankUI.Shared.Michal; namespace DeBankUI.Pages.Michal { public partial class StreamActivityPage { - public void DownloadChartData() - { + [Inject] + public IBlazorDownloadFileService BlazorDownloadFileService { get; set; } + private StreamActivityTotalChart streamActivityTotalChart; + private StreamActivityDailyChart streamActivityDailyChart; + private StreamActivityHistogram streamActivityHistogram; + public async Task DownloadChartData(BaseChartComponent baseComponent, string title) + { + var data = baseComponent.DownloadChartData(); + await BlazorDownloadFileService.DownloadFileAsync(title, data); } } } diff --git a/DeBankUI/Pages/Michal/TopDepositsPage.razor b/DeBankUI/Pages/Michal/TopDepositsPage.razor new file mode 100644 index 0000000..81787b5 --- /dev/null +++ b/DeBankUI/Pages/Michal/TopDepositsPage.razor @@ -0,0 +1,143 @@ +@using DeBankUI.Components; +@using LiveChartsCore.SkiaSharpView.Blazor +@page "/michal/top-deposits" + + + + + + + + TOP Reward Pool depositors + + + + + + + + @foreach (var h in headings) + { + @h + } + + + + @foreach (var row in rewardPoolsTop10Total) + { + + @foreach (var x in row.Split()) + { + @x + } + + } + + + + + + + + + + + Last month TOP Reward Pool depositors [2023-10-15 - 2023-11-15] + + + + + + + + @foreach (var h in headings) + { + @h + } + + + + @foreach (var row in rewardPoolsTop10LastMonth) + { + + @foreach (var x in row.Split()) + { + @x + } + + } + + + + + + + + + + + TOP Lucky Draw depositors + + + + + + + + @foreach (var h in headings) + { + @h + } + + + + @foreach (var row in luckyDrawsTop10Total) + { + + @foreach (var x in row.Split()) + { + @x + } + + } + + + + + + + + + + + Last month TOP Lucky Draw depositors [2023-10-15 - 2023-11-15] + + + + + + + + @foreach (var h in headings) + { + @h + } + + + + @foreach (var row in luckyDrawsTop10LastMonth) + { + + @foreach (var x in row.Split()) + { + @x + } + + } + + + + + + + diff --git a/DeBankUI/Pages/Michal/TopDepositsPage.razor.cs b/DeBankUI/Pages/Michal/TopDepositsPage.razor.cs new file mode 100644 index 0000000..30b1a51 --- /dev/null +++ b/DeBankUI/Pages/Michal/TopDepositsPage.razor.cs @@ -0,0 +1,71 @@ +using LiveChartsCore.Defaults; +using LiveChartsCore.SkiaSharpView; +using LiveChartsCore; +using LiveChartsCore.Kernel.Sketches; +using LiveChartsCore.SkiaSharpView.Painting; +using static MudBlazor.Colors; +using SkiaSharp; +using DeBankUI.Utils; +using DeBankUI.Components; +using Blazor.DownloadFileFast.Interfaces; +using Microsoft.AspNetCore.Components; +using DeBankUI.Shared.Michal; + +namespace DeBankUI.Pages.Michal +{ + public partial class TopDepositsPage + { + string[] headings = {"", "Address", "Total deposit", "Min deposited", "Max deposited", "Average deposit", "Number of deposits" }; + string[] rewardPoolsTop10Total = { + @"1 110118 26180 100 7010 1454,44 18", + @"2 0xbdb7819a671b83e04800a98e00294a67d7d2ec7a 13913,19 0,2 3100 66,25 210", + @"3 0xbdcd88b1967b6e0e47df420e5882286776e74afb 8706,15 0,1 1000 20,78 419", + @"4 0xcedafb4137505a23238e225378293e6c0fde1745 6731,8 0,01 3000 31,90 211", + @"5 0x9ed2af9d4ab71740e4d63fab593be7e8701ea169 5385,78 0,02 1515 50,33 107", + @"6 0xa6ed26749cb54591291b4550a82f15ff64ae98d9 4949,81 0,01 3000 36,40 136", + @"7 0x66b870ddf78c975af5cd8edc6de25eca81791de1 4523,5377 6 777,77 71,80 63", + @"8 0x0228028a0c92cfd9743e561a96b16edbb4606054 4041,9545 0,01 245 7,89 512", + @"9 113837 4000 1000 1000 1000,00 4", + @"10 0x7bfee91193d9df2ac0bfe90191d40f23c773c060 3782,65 1 1208 18,82 201", + }; + + string[] luckyDrawsTop10Total = { + @"1 0x0c86262354095fa35a21b58af3e0dd94d0ba767c 2850 3 1350 64,77 44", + @"2 0xbdc149340cc73b38aebde5f67bae146a1af9e0d6 2399 100 666 342,71 7", + @"3 0a112219 1894 25 250 145,69 13", + @"4 0xd590fca11cd9f50fb164ecd0ded209ab0110cd20 1631 5 150 90,61 18", + @"5 0x4e5ed30e3b4eb39abce3c150f31e180a3ae5806e 1592 192 1200 530,67 3", + @"6 0x009515efabccdbafa485f3919d94c85ff23ba75d 1554 10 500 259,00 6", + @"7 0xbdcd88b1967b6e0e47df420e5882286776e74afb 1429 1 500 68,05 21", + @"8 0x8e17543e388eea7f99bc0736476875dd8d950037 1139 9 1000 189,83 6", + @"9 0x36243ade16d74eedbb3f2b8b2ecf286f538ef5fd 1130 16 128 62,78 18", + @"10 0x7440aec57c5e7bf6226fd319b44a50c2e709fcf6 1051 11 300 75,07 14", + }; + + string[] rewardPoolsTop10LastMonth = { + @"1 0xbdb7819a671b83e04800a98e00294a67d7d2ec7a 9988 1 2000 64,03 156", + @"2 113837 4000 1000 1000 1000,00 4", + @"3 110118 3350 300 1500 837,50 4", + @"4 0x4e5ed30e3b4eb39abce3c150f31e180a3ae5806e 2157,6 0,05 100 10,47 206", + @"5 0x77ef4606add21389906db87674f511391cd9b692 1859,44 5 363 123,96 15", + @"6 0x7522682a93738e7da3ab42959d61cd809fe62440 1810 1 197 54,85 33", + @"7 0xbdcd88b1967b6e0e47df420e5882286776e74afb 1651,68 1 500 20,65 80", + @"8 110771 1120 5 430 35,00 32", + @"9 0x9c01b839c6091e519fd4749efa8b81e190c6d892 1039,16 0,1 100 11,94 87", + @"10 0xbdc149340cc73b38aebde5f67bae146a1af9e0d6 904 1 66 12,05 75", + }; + + string[] luckyDrawsTop10LastMonth = { + @"1 0x97e542ec6b81dea28f212775ce8ac436ab77a7df 660 20 400 94,29 7", + @"2 0x3f2383068de5193b0968d93b05e46b2ee411dd94 560 25 300 93,33 6", + @"3 0x77ef4606add21389906db87674f511391cd9b692 478 3 100 36,77 13", + @"4 0xef7b7bfbc73931d230d4ff165e532d2d2248d1d1 447 1 111 17,19 26", + @"5 0xbdc149340cc73b38aebde5f67bae146a1af9e0d6 333 333 333 333,00 1", + @"6 0xa4b6eeeb7eba0fc360a7402f2ebe90c178115e91 330 2 200 66,00 5", + @"7 0x0c86262354095fa35a21b58af3e0dd94d0ba767c 315 4 101 52,50 6", + @"8 0x00e7a7f1189af18d2416363137dea6fca5cf936a 283 9 76 25,73 11", + @"9 0x111728d5a789c418d1d9a282bf01ba4bb487c96a 257 10 51 18,36 14", + @"10 0xbe934d1a6cd788532912a25eb10c53a00747465d 245 3 100 20,42 12", + }; + } +} diff --git a/DeBankUI/Shared/MainLayout.razor b/DeBankUI/Shared/MainLayout.razor index dab8eb0..b4abe89 100644 --- a/DeBankUI/Shared/MainLayout.razor +++ b/DeBankUI/Shared/MainLayout.razor @@ -17,6 +17,7 @@ Reward Pools Lucky Draws Stream Activity + TOP Deposits diff --git a/DeBankUI/Shared/Michal/LuckyDrawsDailyChart.razor.cs b/DeBankUI/Shared/Michal/LuckyDrawsDailyChart.razor.cs index a9eda8b..ec4acfb 100644 --- a/DeBankUI/Shared/Michal/LuckyDrawsDailyChart.razor.cs +++ b/DeBankUI/Shared/Michal/LuckyDrawsDailyChart.razor.cs @@ -1,314 +1,351 @@ -using DeBankUI.Components; +using CsvHelper; +using DeBankUI.Components; using DeBankUI.Utils; using LiveChartsCore; using LiveChartsCore.Defaults; +using LiveChartsCore.Kernel.Sketches; using LiveChartsCore.SkiaSharpView; using LiveChartsCore.SkiaSharpView.Painting; +using MudBlazor.Extensions; using SkiaSharp; +using System.Globalization; namespace DeBankUI.Shared.Michal { public partial class LuckyDrawsDailyChart : BaseChartComponent { private static readonly SKColor black = SKColors.Black; - private DrawMarginFrame DrawMarginFrame => new() - { - Fill = new SolidColorPaint(Colors.ChartBackground), - Stroke = new SolidColorPaint(Colors.ChartBorder, 2) - }; - private Axis[] XAxes { get; set; } = + public LuckyDrawsDailyChart() { - new DateTimeAxis(TimeSpan.FromDays(1), date => date.ToString("yyyy-MM-dd")) + XAxes = new[] { - LabelsRotation = 30, - TicksPaint = new SolidColorPaint(black), - NamePaint = new SolidColorPaint(black), - LabelsPaint = new SolidColorPaint(black), - } - }; + new DateTimeAxis(TimeSpan.FromDays(1), date => date.ToString("yyyy-MM-dd")) + { + LabelsRotation = 30, + TicksPaint = new SolidColorPaint(black), + NamePaint = new SolidColorPaint(black), + LabelsPaint = new SolidColorPaint(black), + } + }; - private Axis[] YAxes { get; set; } = - { - new Axis - { - Name = "Daily number of Lucky Draws", - NamePaint = new SolidColorPaint(Colors.SerieBlue), - LabelsPaint = new SolidColorPaint(Colors.SerieBlue), - TicksPaint = new SolidColorPaint(Colors.SerieBlue), - SubticksPaint = new SolidColorPaint(Colors.SerieBlue), - }, - new Axis + YAxes = new[] { - Name = "Daily Lucky Draws prizes [$]", - ShowSeparatorLines = false, - Position = LiveChartsCore.Measure.AxisPosition.End, - NamePaint = new SolidColorPaint(Colors.SerieRed), - LabelsPaint = new SolidColorPaint(Colors.SerieRed), - TicksPaint = new SolidColorPaint(Colors.SerieRed), - SubticksPaint = new SolidColorPaint(Colors.SerieRed), - }, - }; - + new Axis + { + Name = "Daily number of Lucky Draws", + NamePaint = new SolidColorPaint(Colors.SerieBlue), + LabelsPaint = new SolidColorPaint(Colors.SerieBlue), + TicksPaint = new SolidColorPaint(Colors.SerieBlue), + SubticksPaint = new SolidColorPaint(Colors.SerieBlue), + }, + new Axis + { + Name = "Daily Lucky Draws prizes [$]", + ShowSeparatorLines = false, + Position = LiveChartsCore.Measure.AxisPosition.End, + NamePaint = new SolidColorPaint(Colors.SerieRed), + LabelsPaint = new SolidColorPaint(Colors.SerieRed), + TicksPaint = new SolidColorPaint(Colors.SerieRed), + SubticksPaint = new SolidColorPaint(Colors.SerieRed), + }, + }; - private ISeries[] Series { get; set; } = - { - new LineSeries + Series = new[] { - Name="Daily number of Lucky Draws", - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - Stroke = new SolidColorPaint(Colors.SerieBlue,4), - GeometryStroke = null, - GeometrySize = 0, - Fill = null, - LineSmoothness = 1, - ScalesYAt = 0, // it will be scaled at the Axis[0] instance - ScalesXAt = 0, - Values = new List + new LineSeries { - new DateTimePoint(new DateTime(2023,7,20),3), - new DateTimePoint(new DateTime(2023,7,21),6), - new DateTimePoint(new DateTime(2023,7,24),1601), - new DateTimePoint(new DateTime(2023,7,25),1106), - new DateTimePoint(new DateTime(2023,7,26),1655), - new DateTimePoint(new DateTime(2023,7,27),1799), - new DateTimePoint(new DateTime(2023,7,28),1351), - new DateTimePoint(new DateTime(2023,7,29),655), - new DateTimePoint(new DateTime(2023,7,30),598), - new DateTimePoint(new DateTime(2023,7,31),722), - new DateTimePoint(new DateTime(2023,8,1),730), - new DateTimePoint(new DateTime(2023,8,2),800), - new DateTimePoint(new DateTime(2023,8,3),692), - new DateTimePoint(new DateTime(2023,8,4),645), - new DateTimePoint(new DateTime(2023,8,5),617), - new DateTimePoint(new DateTime(2023,8,6),611), - new DateTimePoint(new DateTime(2023,8,7),607), - new DateTimePoint(new DateTime(2023,8,8),457), - new DateTimePoint(new DateTime(2023,8,9),350), - new DateTimePoint(new DateTime(2023,8,10),321), - new DateTimePoint(new DateTime(2023,8,11),521), - new DateTimePoint(new DateTime(2023,8,12),485), - new DateTimePoint(new DateTime(2023,8,13),523), - new DateTimePoint(new DateTime(2023,8,14),530), - new DateTimePoint(new DateTime(2023,8,15),575), - new DateTimePoint(new DateTime(2023,8,16),563), - new DateTimePoint(new DateTime(2023,8,17),470), - new DateTimePoint(new DateTime(2023,8,18),540), - new DateTimePoint(new DateTime(2023,8,19),645), - new DateTimePoint(new DateTime(2023,8,20),617), - new DateTimePoint(new DateTime(2023,8,21),618), - new DateTimePoint(new DateTime(2023,8,22),499), - new DateTimePoint(new DateTime(2023,8,23),460), - new DateTimePoint(new DateTime(2023,8,24),512), - new DateTimePoint(new DateTime(2023,8,25),399), - new DateTimePoint(new DateTime(2023,8,26),397), - new DateTimePoint(new DateTime(2023,8,27),364), - new DateTimePoint(new DateTime(2023,8,28),398), - new DateTimePoint(new DateTime(2023,8,29),379), - new DateTimePoint(new DateTime(2023,8,30),338), - new DateTimePoint(new DateTime(2023,8,31),356), - new DateTimePoint(new DateTime(2023,9,1),314), - new DateTimePoint(new DateTime(2023,9,2),284), - new DateTimePoint(new DateTime(2023,9,3),284), - new DateTimePoint(new DateTime(2023,9,4),296), - new DateTimePoint(new DateTime(2023,9,5),269), - new DateTimePoint(new DateTime(2023,9,6),280), - new DateTimePoint(new DateTime(2023,9,7),342), - new DateTimePoint(new DateTime(2023,9,8),285), - new DateTimePoint(new DateTime(2023,9,9),220), - new DateTimePoint(new DateTime(2023,9,10),230), - new DateTimePoint(new DateTime(2023,9,11),240), - new DateTimePoint(new DateTime(2023,9,12),233), - new DateTimePoint(new DateTime(2023,9,13),216), - new DateTimePoint(new DateTime(2023,9,14),211), - new DateTimePoint(new DateTime(2023,9,15),611), - new DateTimePoint(new DateTime(2023,9,16),509), - new DateTimePoint(new DateTime(2023,9,17),479), - new DateTimePoint(new DateTime(2023,9,18),542), - new DateTimePoint(new DateTime(2023,9,19),475), - new DateTimePoint(new DateTime(2023,9,20),393), - new DateTimePoint(new DateTime(2023,9,21),316), - new DateTimePoint(new DateTime(2023,9,22),323), - new DateTimePoint(new DateTime(2023,9,23),307), - new DateTimePoint(new DateTime(2023,9,24),257), - new DateTimePoint(new DateTime(2023,9,25),327), - new DateTimePoint(new DateTime(2023,9,26),311), - new DateTimePoint(new DateTime(2023,9,27),308), - new DateTimePoint(new DateTime(2023,9,28),304), - new DateTimePoint(new DateTime(2023,9,29),268), - new DateTimePoint(new DateTime(2023,9,30),286), - new DateTimePoint(new DateTime(2023,10,1),282), - new DateTimePoint(new DateTime(2023,10,2),332), - new DateTimePoint(new DateTime(2023,10,3),262), - new DateTimePoint(new DateTime(2023,10,4),283), - new DateTimePoint(new DateTime(2023,10,5),259), - new DateTimePoint(new DateTime(2023,10,6),248), - new DateTimePoint(new DateTime(2023,10,7),254), - new DateTimePoint(new DateTime(2023,10,8),242), - new DateTimePoint(new DateTime(2023,10,9),235), - new DateTimePoint(new DateTime(2023,10,10),255), - new DateTimePoint(new DateTime(2023,10,11),331), - new DateTimePoint(new DateTime(2023,10,12),319), - new DateTimePoint(new DateTime(2023,10,13),469), - new DateTimePoint(new DateTime(2023,10,14),418), - new DateTimePoint(new DateTime(2023,10,15),371), - new DateTimePoint(new DateTime(2023,10,16),425), - new DateTimePoint(new DateTime(2023,10,17),357), - new DateTimePoint(new DateTime(2023,10,18),314), - new DateTimePoint(new DateTime(2023,10,19),307), - new DateTimePoint(new DateTime(2023,10,20),520), - new DateTimePoint(new DateTime(2023,10,21),541), - new DateTimePoint(new DateTime(2023,10,22),528), - new DateTimePoint(new DateTime(2023,10,23),475), - new DateTimePoint(new DateTime(2023,10,24),478), - new DateTimePoint(new DateTime(2023,10,25),431), - new DateTimePoint(new DateTime(2023,10,26),427), - new DateTimePoint(new DateTime(2023,10,27),410), - new DateTimePoint(new DateTime(2023,10,28),470), - new DateTimePoint(new DateTime(2023,10,29),395), - new DateTimePoint(new DateTime(2023,10,30),457), - new DateTimePoint(new DateTime(2023,10,31),406), - new DateTimePoint(new DateTime(2023,11,1),396), - new DateTimePoint(new DateTime(2023,11,2),368), - new DateTimePoint(new DateTime(2023,11,3),452), - new DateTimePoint(new DateTime(2023,11,4),402), - new DateTimePoint(new DateTime(2023,11,5),441), - new DateTimePoint(new DateTime(2023,11,6),461), - new DateTimePoint(new DateTime(2023,11,7),445), - new DateTimePoint(new DateTime(2023,11,8),392), - new DateTimePoint(new DateTime(2023,11,9),400), - new DateTimePoint(new DateTime(2023,11,10),480), - new DateTimePoint(new DateTime(2023,11,11),463), - } - }, - new LineSeries - { - Name = "Daily Lucky Draws prizes [$]", - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - Fill = null, - Stroke = new SolidColorPaint(Colors.SerieRed,4), - GeometryStroke = null, - GeometrySize = 0, - LineSmoothness = 1, - ScalesXAt = 0, - ScalesYAt = 1, // it will be scaled at the Axis[0] instance - Values = new List + Name="Daily number of Lucky Draws", + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), + Stroke = new SolidColorPaint(Colors.SerieBlue,4), + GeometryStroke = null, + GeometrySize = 0, + Fill = null, + LineSmoothness = 1, + ScalesYAt = 0, // it will be scaled at the Axis[0] instance + ScalesXAt = 0, + Values = new List + { + new DateTimePoint(new DateTime(2023,7,20),3), + new DateTimePoint(new DateTime(2023,7,21),6), + new DateTimePoint(new DateTime(2023,7,24),1601), + new DateTimePoint(new DateTime(2023,7,25),1106), + new DateTimePoint(new DateTime(2023,7,26),1655), + new DateTimePoint(new DateTime(2023,7,27),1799), + new DateTimePoint(new DateTime(2023,7,28),1351), + new DateTimePoint(new DateTime(2023,7,29),655), + new DateTimePoint(new DateTime(2023,7,30),598), + new DateTimePoint(new DateTime(2023,7,31),722), + new DateTimePoint(new DateTime(2023,8,1),730), + new DateTimePoint(new DateTime(2023,8,2),800), + new DateTimePoint(new DateTime(2023,8,3),692), + new DateTimePoint(new DateTime(2023,8,4),645), + new DateTimePoint(new DateTime(2023,8,5),617), + new DateTimePoint(new DateTime(2023,8,6),611), + new DateTimePoint(new DateTime(2023,8,7),607), + new DateTimePoint(new DateTime(2023,8,8),457), + new DateTimePoint(new DateTime(2023,8,9),350), + new DateTimePoint(new DateTime(2023,8,10),321), + new DateTimePoint(new DateTime(2023,8,11),521), + new DateTimePoint(new DateTime(2023,8,12),485), + new DateTimePoint(new DateTime(2023,8,13),523), + new DateTimePoint(new DateTime(2023,8,14),530), + new DateTimePoint(new DateTime(2023,8,15),575), + new DateTimePoint(new DateTime(2023,8,16),563), + new DateTimePoint(new DateTime(2023,8,17),470), + new DateTimePoint(new DateTime(2023,8,18),540), + new DateTimePoint(new DateTime(2023,8,19),645), + new DateTimePoint(new DateTime(2023,8,20),617), + new DateTimePoint(new DateTime(2023,8,21),618), + new DateTimePoint(new DateTime(2023,8,22),499), + new DateTimePoint(new DateTime(2023,8,23),460), + new DateTimePoint(new DateTime(2023,8,24),512), + new DateTimePoint(new DateTime(2023,8,25),399), + new DateTimePoint(new DateTime(2023,8,26),397), + new DateTimePoint(new DateTime(2023,8,27),364), + new DateTimePoint(new DateTime(2023,8,28),398), + new DateTimePoint(new DateTime(2023,8,29),379), + new DateTimePoint(new DateTime(2023,8,30),338), + new DateTimePoint(new DateTime(2023,8,31),356), + new DateTimePoint(new DateTime(2023,9,1),314), + new DateTimePoint(new DateTime(2023,9,2),284), + new DateTimePoint(new DateTime(2023,9,3),284), + new DateTimePoint(new DateTime(2023,9,4),296), + new DateTimePoint(new DateTime(2023,9,5),269), + new DateTimePoint(new DateTime(2023,9,6),280), + new DateTimePoint(new DateTime(2023,9,7),342), + new DateTimePoint(new DateTime(2023,9,8),285), + new DateTimePoint(new DateTime(2023,9,9),220), + new DateTimePoint(new DateTime(2023,9,10),230), + new DateTimePoint(new DateTime(2023,9,11),240), + new DateTimePoint(new DateTime(2023,9,12),233), + new DateTimePoint(new DateTime(2023,9,13),216), + new DateTimePoint(new DateTime(2023,9,14),211), + new DateTimePoint(new DateTime(2023,9,15),611), + new DateTimePoint(new DateTime(2023,9,16),509), + new DateTimePoint(new DateTime(2023,9,17),479), + new DateTimePoint(new DateTime(2023,9,18),542), + new DateTimePoint(new DateTime(2023,9,19),475), + new DateTimePoint(new DateTime(2023,9,20),393), + new DateTimePoint(new DateTime(2023,9,21),316), + new DateTimePoint(new DateTime(2023,9,22),323), + new DateTimePoint(new DateTime(2023,9,23),307), + new DateTimePoint(new DateTime(2023,9,24),257), + new DateTimePoint(new DateTime(2023,9,25),327), + new DateTimePoint(new DateTime(2023,9,26),311), + new DateTimePoint(new DateTime(2023,9,27),308), + new DateTimePoint(new DateTime(2023,9,28),304), + new DateTimePoint(new DateTime(2023,9,29),268), + new DateTimePoint(new DateTime(2023,9,30),286), + new DateTimePoint(new DateTime(2023,10,1),282), + new DateTimePoint(new DateTime(2023,10,2),332), + new DateTimePoint(new DateTime(2023,10,3),262), + new DateTimePoint(new DateTime(2023,10,4),283), + new DateTimePoint(new DateTime(2023,10,5),259), + new DateTimePoint(new DateTime(2023,10,6),248), + new DateTimePoint(new DateTime(2023,10,7),254), + new DateTimePoint(new DateTime(2023,10,8),242), + new DateTimePoint(new DateTime(2023,10,9),235), + new DateTimePoint(new DateTime(2023,10,10),255), + new DateTimePoint(new DateTime(2023,10,11),331), + new DateTimePoint(new DateTime(2023,10,12),319), + new DateTimePoint(new DateTime(2023,10,13),469), + new DateTimePoint(new DateTime(2023,10,14),418), + new DateTimePoint(new DateTime(2023,10,15),371), + new DateTimePoint(new DateTime(2023,10,16),425), + new DateTimePoint(new DateTime(2023,10,17),357), + new DateTimePoint(new DateTime(2023,10,18),314), + new DateTimePoint(new DateTime(2023,10,19),307), + new DateTimePoint(new DateTime(2023,10,20),520), + new DateTimePoint(new DateTime(2023,10,21),541), + new DateTimePoint(new DateTime(2023,10,22),528), + new DateTimePoint(new DateTime(2023,10,23),475), + new DateTimePoint(new DateTime(2023,10,24),478), + new DateTimePoint(new DateTime(2023,10,25),431), + new DateTimePoint(new DateTime(2023,10,26),427), + new DateTimePoint(new DateTime(2023,10,27),410), + new DateTimePoint(new DateTime(2023,10,28),470), + new DateTimePoint(new DateTime(2023,10,29),395), + new DateTimePoint(new DateTime(2023,10,30),457), + new DateTimePoint(new DateTime(2023,10,31),406), + new DateTimePoint(new DateTime(2023,11,1),396), + new DateTimePoint(new DateTime(2023,11,2),368), + new DateTimePoint(new DateTime(2023,11,3),452), + new DateTimePoint(new DateTime(2023,11,4),402), + new DateTimePoint(new DateTime(2023,11,5),441), + new DateTimePoint(new DateTime(2023,11,6),461), + new DateTimePoint(new DateTime(2023,11,7),445), + new DateTimePoint(new DateTime(2023,11,8),392), + new DateTimePoint(new DateTime(2023,11,9),400), + new DateTimePoint(new DateTime(2023,11,10),480), + new DateTimePoint(new DateTime(2023,11,11),463), + } + }, + new LineSeries { - new DateTimePoint(new DateTime(2023,7,20),0), - new DateTimePoint(new DateTime(2023,7,21),0), - new DateTimePoint(new DateTime(2023,7,24),14438), - new DateTimePoint(new DateTime(2023,7,25),12184), - new DateTimePoint(new DateTime(2023,7,26),10864), - new DateTimePoint(new DateTime(2023,7,27),11773), - new DateTimePoint(new DateTime(2023,7,28),7857), - new DateTimePoint(new DateTime(2023,7,29),3452), - new DateTimePoint(new DateTime(2023,7,30),2910), - new DateTimePoint(new DateTime(2023,7,31),3199), - new DateTimePoint(new DateTime(2023,8,1),4664), - new DateTimePoint(new DateTime(2023,8,2),4289), - new DateTimePoint(new DateTime(2023,8,3),3124), - new DateTimePoint(new DateTime(2023,8,4),2952), - new DateTimePoint(new DateTime(2023,8,5),3482), - new DateTimePoint(new DateTime(2023,8,6),3344), - new DateTimePoint(new DateTime(2023,8,7),2853), - new DateTimePoint(new DateTime(2023,8,8),2252), - new DateTimePoint(new DateTime(2023,8,9),2477), - new DateTimePoint(new DateTime(2023,8,10),1826), - new DateTimePoint(new DateTime(2023,8,11),3346), - new DateTimePoint(new DateTime(2023,8,12),2267), - new DateTimePoint(new DateTime(2023,8,13),2892), - new DateTimePoint(new DateTime(2023,8,14),2999), - new DateTimePoint(new DateTime(2023,8,15),2995), - new DateTimePoint(new DateTime(2023,8,16),2240), - new DateTimePoint(new DateTime(2023,8,17),2531), - new DateTimePoint(new DateTime(2023,8,18),2300), - new DateTimePoint(new DateTime(2023,8,19),3090), - new DateTimePoint(new DateTime(2023,8,20),2698), - new DateTimePoint(new DateTime(2023,8,21),2935), - new DateTimePoint(new DateTime(2023,8,22),3061), - new DateTimePoint(new DateTime(2023,8,23),2606), - new DateTimePoint(new DateTime(2023,8,24),3386), - new DateTimePoint(new DateTime(2023,8,25),2264), - new DateTimePoint(new DateTime(2023,8,26),2446), - new DateTimePoint(new DateTime(2023,8,27),1408), - new DateTimePoint(new DateTime(2023,8,28),2086), - new DateTimePoint(new DateTime(2023,8,29),2140), - new DateTimePoint(new DateTime(2023,8,30),1577), - new DateTimePoint(new DateTime(2023,8,31),1974), - new DateTimePoint(new DateTime(2023,9,1),2987), - new DateTimePoint(new DateTime(2023,9,2),2254), - new DateTimePoint(new DateTime(2023,9,3),1581), - new DateTimePoint(new DateTime(2023,9,4),1291), - new DateTimePoint(new DateTime(2023,9,5),1623), - new DateTimePoint(new DateTime(2023,9,6),1670), - new DateTimePoint(new DateTime(2023,9,7),2801), - new DateTimePoint(new DateTime(2023,9,8),1860), - new DateTimePoint(new DateTime(2023,9,9),865), - new DateTimePoint(new DateTime(2023,9,10),1245), - new DateTimePoint(new DateTime(2023,9,11),1273), - new DateTimePoint(new DateTime(2023,9,12),1621), - new DateTimePoint(new DateTime(2023,9,13),1216), - new DateTimePoint(new DateTime(2023,9,14),1601), - new DateTimePoint(new DateTime(2023,9,15),3919), - new DateTimePoint(new DateTime(2023,9,16),2469), - new DateTimePoint(new DateTime(2023,9,17),2439), - new DateTimePoint(new DateTime(2023,9,18),3178), - new DateTimePoint(new DateTime(2023,9,19),2235), - new DateTimePoint(new DateTime(2023,9,20),1912), - new DateTimePoint(new DateTime(2023,9,21),1863), - new DateTimePoint(new DateTime(2023,9,22),1315), - new DateTimePoint(new DateTime(2023,9,23),1440), - new DateTimePoint(new DateTime(2023,9,24),1310), - new DateTimePoint(new DateTime(2023,9,25),1827), - new DateTimePoint(new DateTime(2023,9,26),1784), - new DateTimePoint(new DateTime(2023,9,27),1625), - new DateTimePoint(new DateTime(2023,9,28),2037), - new DateTimePoint(new DateTime(2023,9,29),1510), - new DateTimePoint(new DateTime(2023,9,30),2214), - new DateTimePoint(new DateTime(2023,10,1),3692), - new DateTimePoint(new DateTime(2023,10,2),2181), - new DateTimePoint(new DateTime(2023,10,3),1088), - new DateTimePoint(new DateTime(2023,10,4),1035), - new DateTimePoint(new DateTime(2023,10,5),1094), - new DateTimePoint(new DateTime(2023,10,6),1842), - new DateTimePoint(new DateTime(2023,10,7),1186), - new DateTimePoint(new DateTime(2023,10,8),1575), - new DateTimePoint(new DateTime(2023,10,9),1151), - new DateTimePoint(new DateTime(2023,10,10),965), - new DateTimePoint(new DateTime(2023,10,11),1240), - new DateTimePoint(new DateTime(2023,10,12),1757), - new DateTimePoint(new DateTime(2023,10,13),1400), - new DateTimePoint(new DateTime(2023,10,14),1802), - new DateTimePoint(new DateTime(2023,10,15),1239), - new DateTimePoint(new DateTime(2023,10,16),1606), - new DateTimePoint(new DateTime(2023,10,17),1315), - new DateTimePoint(new DateTime(2023,10,18),1349), - new DateTimePoint(new DateTime(2023,10,19),1151), - new DateTimePoint(new DateTime(2023,10,20),1238), - new DateTimePoint(new DateTime(2023,10,21),1189), - new DateTimePoint(new DateTime(2023,10,22),1317), - new DateTimePoint(new DateTime(2023,10,23),1315), - new DateTimePoint(new DateTime(2023,10,24),1451), - new DateTimePoint(new DateTime(2023,10,25),1175), - new DateTimePoint(new DateTime(2023,10,26),1282), - new DateTimePoint(new DateTime(2023,10,27),1108), - new DateTimePoint(new DateTime(2023,10,28),1389), - new DateTimePoint(new DateTime(2023,10,29),1151), - new DateTimePoint(new DateTime(2023,10,30),1356), - new DateTimePoint(new DateTime(2023,10,31),1683), - new DateTimePoint(new DateTime(2023,11,1),1860), - new DateTimePoint(new DateTime(2023,11,2),1198), - new DateTimePoint(new DateTime(2023,11,3),1344), - new DateTimePoint(new DateTime(2023,11,4),1402), - new DateTimePoint(new DateTime(2023,11,5),1492), - new DateTimePoint(new DateTime(2023,11,6),1545), - new DateTimePoint(new DateTime(2023,11,7),1425), - new DateTimePoint(new DateTime(2023,11,8),1358), - new DateTimePoint(new DateTime(2023,11,9),1315), - new DateTimePoint(new DateTime(2023,11,10),2368), - new DateTimePoint(new DateTime(2023,11,11),1698), + Name = "Daily Lucky Draws prizes [$]", + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), + Fill = null, + Stroke = new SolidColorPaint(Colors.SerieRed,4), + GeometryStroke = null, + GeometrySize = 0, + LineSmoothness = 1, + ScalesXAt = 0, + ScalesYAt = 1, // it will be scaled at the Axis[0] instance + Values = new List + { + new DateTimePoint(new DateTime(2023,7,20),0), + new DateTimePoint(new DateTime(2023,7,21),0), + new DateTimePoint(new DateTime(2023,7,24),14438), + new DateTimePoint(new DateTime(2023,7,25),12184), + new DateTimePoint(new DateTime(2023,7,26),10864), + new DateTimePoint(new DateTime(2023,7,27),11773), + new DateTimePoint(new DateTime(2023,7,28),7857), + new DateTimePoint(new DateTime(2023,7,29),3452), + new DateTimePoint(new DateTime(2023,7,30),2910), + new DateTimePoint(new DateTime(2023,7,31),3199), + new DateTimePoint(new DateTime(2023,8,1),4664), + new DateTimePoint(new DateTime(2023,8,2),4289), + new DateTimePoint(new DateTime(2023,8,3),3124), + new DateTimePoint(new DateTime(2023,8,4),2952), + new DateTimePoint(new DateTime(2023,8,5),3482), + new DateTimePoint(new DateTime(2023,8,6),3344), + new DateTimePoint(new DateTime(2023,8,7),2853), + new DateTimePoint(new DateTime(2023,8,8),2252), + new DateTimePoint(new DateTime(2023,8,9),2477), + new DateTimePoint(new DateTime(2023,8,10),1826), + new DateTimePoint(new DateTime(2023,8,11),3346), + new DateTimePoint(new DateTime(2023,8,12),2267), + new DateTimePoint(new DateTime(2023,8,13),2892), + new DateTimePoint(new DateTime(2023,8,14),2999), + new DateTimePoint(new DateTime(2023,8,15),2995), + new DateTimePoint(new DateTime(2023,8,16),2240), + new DateTimePoint(new DateTime(2023,8,17),2531), + new DateTimePoint(new DateTime(2023,8,18),2300), + new DateTimePoint(new DateTime(2023,8,19),3090), + new DateTimePoint(new DateTime(2023,8,20),2698), + new DateTimePoint(new DateTime(2023,8,21),2935), + new DateTimePoint(new DateTime(2023,8,22),3061), + new DateTimePoint(new DateTime(2023,8,23),2606), + new DateTimePoint(new DateTime(2023,8,24),3386), + new DateTimePoint(new DateTime(2023,8,25),2264), + new DateTimePoint(new DateTime(2023,8,26),2446), + new DateTimePoint(new DateTime(2023,8,27),1408), + new DateTimePoint(new DateTime(2023,8,28),2086), + new DateTimePoint(new DateTime(2023,8,29),2140), + new DateTimePoint(new DateTime(2023,8,30),1577), + new DateTimePoint(new DateTime(2023,8,31),1974), + new DateTimePoint(new DateTime(2023,9,1),2987), + new DateTimePoint(new DateTime(2023,9,2),2254), + new DateTimePoint(new DateTime(2023,9,3),1581), + new DateTimePoint(new DateTime(2023,9,4),1291), + new DateTimePoint(new DateTime(2023,9,5),1623), + new DateTimePoint(new DateTime(2023,9,6),1670), + new DateTimePoint(new DateTime(2023,9,7),2801), + new DateTimePoint(new DateTime(2023,9,8),1860), + new DateTimePoint(new DateTime(2023,9,9),865), + new DateTimePoint(new DateTime(2023,9,10),1245), + new DateTimePoint(new DateTime(2023,9,11),1273), + new DateTimePoint(new DateTime(2023,9,12),1621), + new DateTimePoint(new DateTime(2023,9,13),1216), + new DateTimePoint(new DateTime(2023,9,14),1601), + new DateTimePoint(new DateTime(2023,9,15),3919), + new DateTimePoint(new DateTime(2023,9,16),2469), + new DateTimePoint(new DateTime(2023,9,17),2439), + new DateTimePoint(new DateTime(2023,9,18),3178), + new DateTimePoint(new DateTime(2023,9,19),2235), + new DateTimePoint(new DateTime(2023,9,20),1912), + new DateTimePoint(new DateTime(2023,9,21),1863), + new DateTimePoint(new DateTime(2023,9,22),1315), + new DateTimePoint(new DateTime(2023,9,23),1440), + new DateTimePoint(new DateTime(2023,9,24),1310), + new DateTimePoint(new DateTime(2023,9,25),1827), + new DateTimePoint(new DateTime(2023,9,26),1784), + new DateTimePoint(new DateTime(2023,9,27),1625), + new DateTimePoint(new DateTime(2023,9,28),2037), + new DateTimePoint(new DateTime(2023,9,29),1510), + new DateTimePoint(new DateTime(2023,9,30),2214), + new DateTimePoint(new DateTime(2023,10,1),3692), + new DateTimePoint(new DateTime(2023,10,2),2181), + new DateTimePoint(new DateTime(2023,10,3),1088), + new DateTimePoint(new DateTime(2023,10,4),1035), + new DateTimePoint(new DateTime(2023,10,5),1094), + new DateTimePoint(new DateTime(2023,10,6),1842), + new DateTimePoint(new DateTime(2023,10,7),1186), + new DateTimePoint(new DateTime(2023,10,8),1575), + new DateTimePoint(new DateTime(2023,10,9),1151), + new DateTimePoint(new DateTime(2023,10,10),965), + new DateTimePoint(new DateTime(2023,10,11),1240), + new DateTimePoint(new DateTime(2023,10,12),1757), + new DateTimePoint(new DateTime(2023,10,13),1400), + new DateTimePoint(new DateTime(2023,10,14),1802), + new DateTimePoint(new DateTime(2023,10,15),1239), + new DateTimePoint(new DateTime(2023,10,16),1606), + new DateTimePoint(new DateTime(2023,10,17),1315), + new DateTimePoint(new DateTime(2023,10,18),1349), + new DateTimePoint(new DateTime(2023,10,19),1151), + new DateTimePoint(new DateTime(2023,10,20),1238), + new DateTimePoint(new DateTime(2023,10,21),1189), + new DateTimePoint(new DateTime(2023,10,22),1317), + new DateTimePoint(new DateTime(2023,10,23),1315), + new DateTimePoint(new DateTime(2023,10,24),1451), + new DateTimePoint(new DateTime(2023,10,25),1175), + new DateTimePoint(new DateTime(2023,10,26),1282), + new DateTimePoint(new DateTime(2023,10,27),1108), + new DateTimePoint(new DateTime(2023,10,28),1389), + new DateTimePoint(new DateTime(2023,10,29),1151), + new DateTimePoint(new DateTime(2023,10,30),1356), + new DateTimePoint(new DateTime(2023,10,31),1683), + new DateTimePoint(new DateTime(2023,11,1),1860), + new DateTimePoint(new DateTime(2023,11,2),1198), + new DateTimePoint(new DateTime(2023,11,3),1344), + new DateTimePoint(new DateTime(2023,11,4),1402), + new DateTimePoint(new DateTime(2023,11,5),1492), + new DateTimePoint(new DateTime(2023,11,6),1545), + new DateTimePoint(new DateTime(2023,11,7),1425), + new DateTimePoint(new DateTime(2023,11,8),1358), + new DateTimePoint(new DateTime(2023,11,9),1315), + new DateTimePoint(new DateTime(2023,11,10),2368), + new DateTimePoint(new DateTime(2023,11,11),1698), + } } + }; + } + + public override byte[] DownloadChartData() + { + var dailySerie = Series[0].As>(); + var prizeSerie = Series[1].As>(); + + var dailySerieValues = dailySerie.Values.ToList(); + var prizeSerieValues = prizeSerie.Values.ToList(); + var records = new List(); + + for (int i = 0; i < dailySerie.Values.Count(); i++) + { + records.Add(new CsvData + { + Date = dailySerieValues[i].DateTime, + DailyDraws = dailySerieValues[i].Value, + DailyPrizes = prizeSerieValues[i].Value, + }); } - }; + + using (var stream = new MemoryStream()) + using (var writer = new StreamWriter(stream)) + using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) + { + csv.WriteRecords(records); + writer.Flush(); + return stream.ToArray(); + } + } + + private class CsvData + { + public DateTime Date { get; set; } + public double? DailyPrizes { get; set; } + public double? DailyDraws { get; set; } + } } } diff --git a/DeBankUI/Shared/Michal/LuckyDrawsHistogram.razor.cs b/DeBankUI/Shared/Michal/LuckyDrawsHistogram.razor.cs index f2ca62c..2e0dd1e 100644 --- a/DeBankUI/Shared/Michal/LuckyDrawsHistogram.razor.cs +++ b/DeBankUI/Shared/Michal/LuckyDrawsHistogram.razor.cs @@ -1,46 +1,79 @@ -using DeBankUI.Components; +using CsvHelper; +using DeBankUI.Components; using DeBankUI.Utils; using LiveChartsCore; using LiveChartsCore.Defaults; using LiveChartsCore.SkiaSharpView; using LiveChartsCore.SkiaSharpView.Painting; +using MudBlazor.Extensions; using SkiaSharp; +using System.Globalization; namespace DeBankUI.Shared.Michal { public partial class LuckyDrawsHistogram : BaseChartComponent { private static readonly SKColor black = SKColors.Black; - private DrawMarginFrame DrawMarginFrame => new() - { - Fill = new SolidColorPaint(Colors.ChartBackground), - Stroke = new SolidColorPaint(Colors.ChartBorder, 2) - }; - public ISeries[] Series { get; set; } = + public LuckyDrawsHistogram() { - new ColumnSeries + Series = new [] { - Name = "Number of Lucky Draws", - Values = new double[] { 3662, 23255, 13132, 7614, 5665, 1586 }, - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - }, - }; + new ColumnSeries + { + Name = "Number of Lucky Draws", + Values = new int[] { 3662, 23255, 13132, 7614, 5665, 1586 }, + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0, 0), + }, + }; - public Axis[] YAxes { get; set; } = - { - new Axis { MinLimit = 0 } - }; + YAxes = new [] + { + new Axis { MinLimit = 0 } + }; - public Axis[] XAxes { get; set; } = + XAxes = new[] + { + new Axis + { + Labels = new string[] { "<$1", "$1-$2", "$2-$5", "$5-$10", "$10-$25", ">$25" }, + LabelsRotation = 0, + SeparatorsAtCenter = false, + ForceStepToMin = true, + } + }; + } + + public override byte[] DownloadChartData() { - new Axis + var columnSerie = Series[0].As>(); + var columnSerieValues = columnSerie.Values.ToList(); + var columnSerieCategories = XAxes[0].Labels.ToList(); + var records = new List(); + + for (int i = 0; i < columnSerie.Values.Count(); i++) { - Labels = new string[] { "<$1", "$1-$2", "$2-$5", "$5-$10", "$10-$25", ">$25" }, - LabelsRotation = 0, - SeparatorsAtCenter = false, - ForceStepToMin = true, + records.Add(new CsvData + { + DrawNumbers = columnSerieValues[i], + Prize = columnSerieCategories[i], + }); } - }; + + using (var stream = new MemoryStream()) + using (var writer = new StreamWriter(stream)) + using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) + { + csv.WriteRecords(records); + writer.Flush(); + return stream.ToArray(); + } + } + + private class CsvData + { + public string? Prize { get; set; } + public int? DrawNumbers { get; set; } + } } } diff --git a/DeBankUI/Shared/Michal/LuckyDrawsTotalChart.razor.cs b/DeBankUI/Shared/Michal/LuckyDrawsTotalChart.razor.cs index 33c7251..885960c 100644 --- a/DeBankUI/Shared/Michal/LuckyDrawsTotalChart.razor.cs +++ b/DeBankUI/Shared/Michal/LuckyDrawsTotalChart.razor.cs @@ -1,314 +1,351 @@ -using DeBankUI.Components; +using CsvHelper; +using DeBankUI.Components; using DeBankUI.Utils; using LiveChartsCore; using LiveChartsCore.Defaults; using LiveChartsCore.SkiaSharpView; using LiveChartsCore.SkiaSharpView.Painting; +using MudBlazor.Extensions; using SkiaSharp; +using System.Globalization; namespace DeBankUI.Shared.Michal { public partial class LuckyDrawsTotalChart : BaseChartComponent { private static readonly SKColor black = SKColors.Black; - private DrawMarginFrame DrawMarginFrame => new() - { - Fill = new SolidColorPaint(Colors.ChartBackground), - Stroke = new SolidColorPaint(Colors.ChartBorder, 2) - }; - private Axis[] XAxes { get; set; } = - { - new DateTimeAxis(TimeSpan.FromDays(1), date => date.ToString("yyyy-MM-dd")) - { - LabelsRotation = 30, - TicksPaint = new SolidColorPaint(black), - NamePaint = new SolidColorPaint(black), - LabelsPaint = new SolidColorPaint(black), - } - }; - private Axis[] YAxes { get; set; } = + public LuckyDrawsTotalChart() { - new Axis - { - Name = "Total number of Lucky Draws", - NamePaint = new SolidColorPaint(Colors.SerieBlue), - LabelsPaint = new SolidColorPaint(Colors.SerieBlue), - TicksPaint = new SolidColorPaint(Colors.SerieBlue), - SubticksPaint = new SolidColorPaint(Colors.SerieBlue), - }, - new Axis + XAxes = new[] { - Name = "Total Lucky Draws prizes [$]", - ShowSeparatorLines = false, - Position = LiveChartsCore.Measure.AxisPosition.End, - NamePaint = new SolidColorPaint(Colors.SerieRed), - LabelsPaint = new SolidColorPaint(Colors.SerieRed), - TicksPaint = new SolidColorPaint(Colors.SerieRed), - SubticksPaint = new SolidColorPaint(Colors.SerieRed), - }, - }; + new DateTimeAxis(TimeSpan.FromDays(1), date => date.ToString("yyyy-MM-dd")) + { + LabelsRotation = 30, + TicksPaint = new SolidColorPaint(black), + NamePaint = new SolidColorPaint(black), + LabelsPaint = new SolidColorPaint(black), + } + }; + YAxes = new[] + { + new Axis + { + Name = "Total number of Lucky Draws", + NamePaint = new SolidColorPaint(Colors.SerieBlue), + LabelsPaint = new SolidColorPaint(Colors.SerieBlue), + TicksPaint = new SolidColorPaint(Colors.SerieBlue), + SubticksPaint = new SolidColorPaint(Colors.SerieBlue), + }, + new Axis + { + Name = "Total Lucky Draws prizes [$]", + ShowSeparatorLines = false, + Position = LiveChartsCore.Measure.AxisPosition.End, + NamePaint = new SolidColorPaint(Colors.SerieRed), + LabelsPaint = new SolidColorPaint(Colors.SerieRed), + TicksPaint = new SolidColorPaint(Colors.SerieRed), + SubticksPaint = new SolidColorPaint(Colors.SerieRed), + }, + }; - private ISeries[] Series { get; set; } = - { - new LineSeries + Series = new[] { - Name="Total number of Lucky Draws", - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - Stroke = new SolidColorPaint(Colors.SerieBlue,4), - GeometryStroke = null, - GeometrySize = 0, - Fill = null, - LineSmoothness = 1, - ScalesYAt = 0, // it will be scaled at the Axis[0] instance - ScalesXAt = 0, - Values = new List + new LineSeries { - new DateTimePoint(new DateTime(2023,7,20),3), - new DateTimePoint(new DateTime(2023,7,21),9), - new DateTimePoint(new DateTime(2023,7,24),1610), - new DateTimePoint(new DateTime(2023,7,25),2716), - new DateTimePoint(new DateTime(2023,7,26),4371), - new DateTimePoint(new DateTime(2023,7,27),6170), - new DateTimePoint(new DateTime(2023,7,28),7521), - new DateTimePoint(new DateTime(2023,7,29),8176), - new DateTimePoint(new DateTime(2023,7,30),8774), - new DateTimePoint(new DateTime(2023,7,31),9496), - new DateTimePoint(new DateTime(2023,8,1),10226), - new DateTimePoint(new DateTime(2023,8,2),11026), - new DateTimePoint(new DateTime(2023,8,3),11718), - new DateTimePoint(new DateTime(2023,8,4),12363), - new DateTimePoint(new DateTime(2023,8,5),12980), - new DateTimePoint(new DateTime(2023,8,6),13591), - new DateTimePoint(new DateTime(2023,8,7),14198), - new DateTimePoint(new DateTime(2023,8,8),14655), - new DateTimePoint(new DateTime(2023,8,9),15005), - new DateTimePoint(new DateTime(2023,8,10),15326), - new DateTimePoint(new DateTime(2023,8,11),15847), - new DateTimePoint(new DateTime(2023,8,12),16332), - new DateTimePoint(new DateTime(2023,8,13),16855), - new DateTimePoint(new DateTime(2023,8,14),17385), - new DateTimePoint(new DateTime(2023,8,15),17960), - new DateTimePoint(new DateTime(2023,8,16),18523), - new DateTimePoint(new DateTime(2023,8,17),18993), - new DateTimePoint(new DateTime(2023,8,18),19533), - new DateTimePoint(new DateTime(2023,8,19),20178), - new DateTimePoint(new DateTime(2023,8,20),20795), - new DateTimePoint(new DateTime(2023,8,21),21413), - new DateTimePoint(new DateTime(2023,8,22),21912), - new DateTimePoint(new DateTime(2023,8,23),22372), - new DateTimePoint(new DateTime(2023,8,24),22884), - new DateTimePoint(new DateTime(2023,8,25),23283), - new DateTimePoint(new DateTime(2023,8,26),23680), - new DateTimePoint(new DateTime(2023,8,27),24044), - new DateTimePoint(new DateTime(2023,8,28),24442), - new DateTimePoint(new DateTime(2023,8,29),24821), - new DateTimePoint(new DateTime(2023,8,30),25159), - new DateTimePoint(new DateTime(2023,8,31),25515), - new DateTimePoint(new DateTime(2023,9,1),25829), - new DateTimePoint(new DateTime(2023,9,2),26113), - new DateTimePoint(new DateTime(2023,9,3),26397), - new DateTimePoint(new DateTime(2023,9,4),26693), - new DateTimePoint(new DateTime(2023,9,5),26962), - new DateTimePoint(new DateTime(2023,9,6),27242), - new DateTimePoint(new DateTime(2023,9,7),27584), - new DateTimePoint(new DateTime(2023,9,8),27869), - new DateTimePoint(new DateTime(2023,9,9),28089), - new DateTimePoint(new DateTime(2023,9,10),28319), - new DateTimePoint(new DateTime(2023,9,11),28559), - new DateTimePoint(new DateTime(2023,9,12),28792), - new DateTimePoint(new DateTime(2023,9,13),29008), - new DateTimePoint(new DateTime(2023,9,14),29219), - new DateTimePoint(new DateTime(2023,9,15),29830), - new DateTimePoint(new DateTime(2023,9,16),30339), - new DateTimePoint(new DateTime(2023,9,17),30818), - new DateTimePoint(new DateTime(2023,9,18),31360), - new DateTimePoint(new DateTime(2023,9,19),31835), - new DateTimePoint(new DateTime(2023,9,20),32228), - new DateTimePoint(new DateTime(2023,9,21),32544), - new DateTimePoint(new DateTime(2023,9,22),32867), - new DateTimePoint(new DateTime(2023,9,23),33174), - new DateTimePoint(new DateTime(2023,9,24),33431), - new DateTimePoint(new DateTime(2023,9,25),33758), - new DateTimePoint(new DateTime(2023,9,26),34069), - new DateTimePoint(new DateTime(2023,9,27),34377), - new DateTimePoint(new DateTime(2023,9,28),34681), - new DateTimePoint(new DateTime(2023,9,29),34949), - new DateTimePoint(new DateTime(2023,9,30),35235), - new DateTimePoint(new DateTime(2023,10,1),35517), - new DateTimePoint(new DateTime(2023,10,2),35849), - new DateTimePoint(new DateTime(2023,10,3),36111), - new DateTimePoint(new DateTime(2023,10,4),36394), - new DateTimePoint(new DateTime(2023,10,5),36653), - new DateTimePoint(new DateTime(2023,10,6),36901), - new DateTimePoint(new DateTime(2023,10,7),37155), - new DateTimePoint(new DateTime(2023,10,8),37397), - new DateTimePoint(new DateTime(2023,10,9),37632), - new DateTimePoint(new DateTime(2023,10,10),37887), - new DateTimePoint(new DateTime(2023,10,11),38218), - new DateTimePoint(new DateTime(2023,10,12),38537), - new DateTimePoint(new DateTime(2023,10,13),39006), - new DateTimePoint(new DateTime(2023,10,14),39424), - new DateTimePoint(new DateTime(2023,10,15),39795), - new DateTimePoint(new DateTime(2023,10,16),40220), - new DateTimePoint(new DateTime(2023,10,17),40577), - new DateTimePoint(new DateTime(2023,10,18),40891), - new DateTimePoint(new DateTime(2023,10,19),41198), - new DateTimePoint(new DateTime(2023,10,20),41718), - new DateTimePoint(new DateTime(2023,10,21),42259), - new DateTimePoint(new DateTime(2023,10,22),42787), - new DateTimePoint(new DateTime(2023,10,23),43262), - new DateTimePoint(new DateTime(2023,10,24),43740), - new DateTimePoint(new DateTime(2023,10,25),44171), - new DateTimePoint(new DateTime(2023,10,26),44598), - new DateTimePoint(new DateTime(2023,10,27),45008), - new DateTimePoint(new DateTime(2023,10,28),45478), - new DateTimePoint(new DateTime(2023,10,29),45873), - new DateTimePoint(new DateTime(2023,10,30),46330), - new DateTimePoint(new DateTime(2023,10,31),46736), - new DateTimePoint(new DateTime(2023,11,1),47132), - new DateTimePoint(new DateTime(2023,11,2),47500), - new DateTimePoint(new DateTime(2023,11,3),47952), - new DateTimePoint(new DateTime(2023,11,4),48354), - new DateTimePoint(new DateTime(2023,11,5),48795), - new DateTimePoint(new DateTime(2023,11,6),49256), - new DateTimePoint(new DateTime(2023,11,7),49701), - new DateTimePoint(new DateTime(2023,11,8),50093), - new DateTimePoint(new DateTime(2023,11,9),50493), - new DateTimePoint(new DateTime(2023,11,10),50973), - new DateTimePoint(new DateTime(2023,11,11),51436), + Name="Total number of Lucky Draws", + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), + Stroke = new SolidColorPaint(Colors.SerieBlue,4), + GeometryStroke = null, + GeometrySize = 0, + Fill = null, + LineSmoothness = 1, + ScalesYAt = 0, // it will be scaled at the Axis[0] instance + ScalesXAt = 0, + Values = new List + { + new DateTimePoint(new DateTime(2023,7,20),3), + new DateTimePoint(new DateTime(2023,7,21),9), + new DateTimePoint(new DateTime(2023,7,24),1610), + new DateTimePoint(new DateTime(2023,7,25),2716), + new DateTimePoint(new DateTime(2023,7,26),4371), + new DateTimePoint(new DateTime(2023,7,27),6170), + new DateTimePoint(new DateTime(2023,7,28),7521), + new DateTimePoint(new DateTime(2023,7,29),8176), + new DateTimePoint(new DateTime(2023,7,30),8774), + new DateTimePoint(new DateTime(2023,7,31),9496), + new DateTimePoint(new DateTime(2023,8,1),10226), + new DateTimePoint(new DateTime(2023,8,2),11026), + new DateTimePoint(new DateTime(2023,8,3),11718), + new DateTimePoint(new DateTime(2023,8,4),12363), + new DateTimePoint(new DateTime(2023,8,5),12980), + new DateTimePoint(new DateTime(2023,8,6),13591), + new DateTimePoint(new DateTime(2023,8,7),14198), + new DateTimePoint(new DateTime(2023,8,8),14655), + new DateTimePoint(new DateTime(2023,8,9),15005), + new DateTimePoint(new DateTime(2023,8,10),15326), + new DateTimePoint(new DateTime(2023,8,11),15847), + new DateTimePoint(new DateTime(2023,8,12),16332), + new DateTimePoint(new DateTime(2023,8,13),16855), + new DateTimePoint(new DateTime(2023,8,14),17385), + new DateTimePoint(new DateTime(2023,8,15),17960), + new DateTimePoint(new DateTime(2023,8,16),18523), + new DateTimePoint(new DateTime(2023,8,17),18993), + new DateTimePoint(new DateTime(2023,8,18),19533), + new DateTimePoint(new DateTime(2023,8,19),20178), + new DateTimePoint(new DateTime(2023,8,20),20795), + new DateTimePoint(new DateTime(2023,8,21),21413), + new DateTimePoint(new DateTime(2023,8,22),21912), + new DateTimePoint(new DateTime(2023,8,23),22372), + new DateTimePoint(new DateTime(2023,8,24),22884), + new DateTimePoint(new DateTime(2023,8,25),23283), + new DateTimePoint(new DateTime(2023,8,26),23680), + new DateTimePoint(new DateTime(2023,8,27),24044), + new DateTimePoint(new DateTime(2023,8,28),24442), + new DateTimePoint(new DateTime(2023,8,29),24821), + new DateTimePoint(new DateTime(2023,8,30),25159), + new DateTimePoint(new DateTime(2023,8,31),25515), + new DateTimePoint(new DateTime(2023,9,1),25829), + new DateTimePoint(new DateTime(2023,9,2),26113), + new DateTimePoint(new DateTime(2023,9,3),26397), + new DateTimePoint(new DateTime(2023,9,4),26693), + new DateTimePoint(new DateTime(2023,9,5),26962), + new DateTimePoint(new DateTime(2023,9,6),27242), + new DateTimePoint(new DateTime(2023,9,7),27584), + new DateTimePoint(new DateTime(2023,9,8),27869), + new DateTimePoint(new DateTime(2023,9,9),28089), + new DateTimePoint(new DateTime(2023,9,10),28319), + new DateTimePoint(new DateTime(2023,9,11),28559), + new DateTimePoint(new DateTime(2023,9,12),28792), + new DateTimePoint(new DateTime(2023,9,13),29008), + new DateTimePoint(new DateTime(2023,9,14),29219), + new DateTimePoint(new DateTime(2023,9,15),29830), + new DateTimePoint(new DateTime(2023,9,16),30339), + new DateTimePoint(new DateTime(2023,9,17),30818), + new DateTimePoint(new DateTime(2023,9,18),31360), + new DateTimePoint(new DateTime(2023,9,19),31835), + new DateTimePoint(new DateTime(2023,9,20),32228), + new DateTimePoint(new DateTime(2023,9,21),32544), + new DateTimePoint(new DateTime(2023,9,22),32867), + new DateTimePoint(new DateTime(2023,9,23),33174), + new DateTimePoint(new DateTime(2023,9,24),33431), + new DateTimePoint(new DateTime(2023,9,25),33758), + new DateTimePoint(new DateTime(2023,9,26),34069), + new DateTimePoint(new DateTime(2023,9,27),34377), + new DateTimePoint(new DateTime(2023,9,28),34681), + new DateTimePoint(new DateTime(2023,9,29),34949), + new DateTimePoint(new DateTime(2023,9,30),35235), + new DateTimePoint(new DateTime(2023,10,1),35517), + new DateTimePoint(new DateTime(2023,10,2),35849), + new DateTimePoint(new DateTime(2023,10,3),36111), + new DateTimePoint(new DateTime(2023,10,4),36394), + new DateTimePoint(new DateTime(2023,10,5),36653), + new DateTimePoint(new DateTime(2023,10,6),36901), + new DateTimePoint(new DateTime(2023,10,7),37155), + new DateTimePoint(new DateTime(2023,10,8),37397), + new DateTimePoint(new DateTime(2023,10,9),37632), + new DateTimePoint(new DateTime(2023,10,10),37887), + new DateTimePoint(new DateTime(2023,10,11),38218), + new DateTimePoint(new DateTime(2023,10,12),38537), + new DateTimePoint(new DateTime(2023,10,13),39006), + new DateTimePoint(new DateTime(2023,10,14),39424), + new DateTimePoint(new DateTime(2023,10,15),39795), + new DateTimePoint(new DateTime(2023,10,16),40220), + new DateTimePoint(new DateTime(2023,10,17),40577), + new DateTimePoint(new DateTime(2023,10,18),40891), + new DateTimePoint(new DateTime(2023,10,19),41198), + new DateTimePoint(new DateTime(2023,10,20),41718), + new DateTimePoint(new DateTime(2023,10,21),42259), + new DateTimePoint(new DateTime(2023,10,22),42787), + new DateTimePoint(new DateTime(2023,10,23),43262), + new DateTimePoint(new DateTime(2023,10,24),43740), + new DateTimePoint(new DateTime(2023,10,25),44171), + new DateTimePoint(new DateTime(2023,10,26),44598), + new DateTimePoint(new DateTime(2023,10,27),45008), + new DateTimePoint(new DateTime(2023,10,28),45478), + new DateTimePoint(new DateTime(2023,10,29),45873), + new DateTimePoint(new DateTime(2023,10,30),46330), + new DateTimePoint(new DateTime(2023,10,31),46736), + new DateTimePoint(new DateTime(2023,11,1),47132), + new DateTimePoint(new DateTime(2023,11,2),47500), + new DateTimePoint(new DateTime(2023,11,3),47952), + new DateTimePoint(new DateTime(2023,11,4),48354), + new DateTimePoint(new DateTime(2023,11,5),48795), + new DateTimePoint(new DateTime(2023,11,6),49256), + new DateTimePoint(new DateTime(2023,11,7),49701), + new DateTimePoint(new DateTime(2023,11,8),50093), + new DateTimePoint(new DateTime(2023,11,9),50493), + new DateTimePoint(new DateTime(2023,11,10),50973), + new DateTimePoint(new DateTime(2023,11,11),51436), + } + }, + new LineSeries + { + Name = "Total Lucky Draws prizes [$]", + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), + Fill = null, + Stroke = new SolidColorPaint(Colors.SerieRed,4), + GeometryStroke = null, + GeometrySize = 0, + LineSmoothness = 1, + ScalesXAt = 0, + ScalesYAt = 1, // it will be scaled at the Axis[0] instance + Values = new List + { + new DateTimePoint(new DateTime(2023,7,20),0), + new DateTimePoint(new DateTime(2023,7,21),0), + new DateTimePoint(new DateTime(2023,7,24),14439), + new DateTimePoint(new DateTime(2023,7,25),26623), + new DateTimePoint(new DateTime(2023,7,26),37487), + new DateTimePoint(new DateTime(2023,7,27),49260), + new DateTimePoint(new DateTime(2023,7,28),57117), + new DateTimePoint(new DateTime(2023,7,29),60569), + new DateTimePoint(new DateTime(2023,7,30),63479), + new DateTimePoint(new DateTime(2023,7,31),66678), + new DateTimePoint(new DateTime(2023,8,1),71342), + new DateTimePoint(new DateTime(2023,8,2),75631), + new DateTimePoint(new DateTime(2023,8,3),78755), + new DateTimePoint(new DateTime(2023,8,4),81707), + new DateTimePoint(new DateTime(2023,8,5),85189), + new DateTimePoint(new DateTime(2023,8,6),88533), + new DateTimePoint(new DateTime(2023,8,7),91386), + new DateTimePoint(new DateTime(2023,8,8),93638), + new DateTimePoint(new DateTime(2023,8,9),96115), + new DateTimePoint(new DateTime(2023,8,10),97941), + new DateTimePoint(new DateTime(2023,8,11),101287), + new DateTimePoint(new DateTime(2023,8,12),103554), + new DateTimePoint(new DateTime(2023,8,13),106446), + new DateTimePoint(new DateTime(2023,8,14),109445), + new DateTimePoint(new DateTime(2023,8,15),112440), + new DateTimePoint(new DateTime(2023,8,16),114680), + new DateTimePoint(new DateTime(2023,8,17),117211), + new DateTimePoint(new DateTime(2023,8,18),119511), + new DateTimePoint(new DateTime(2023,8,19),122601), + new DateTimePoint(new DateTime(2023,8,20),125299), + new DateTimePoint(new DateTime(2023,8,21),128234), + new DateTimePoint(new DateTime(2023,8,22),131295), + new DateTimePoint(new DateTime(2023,8,23),133901), + new DateTimePoint(new DateTime(2023,8,24),137287), + new DateTimePoint(new DateTime(2023,8,25),139551), + new DateTimePoint(new DateTime(2023,8,26),141997), + new DateTimePoint(new DateTime(2023,8,27),143405), + new DateTimePoint(new DateTime(2023,8,28),145491), + new DateTimePoint(new DateTime(2023,8,29),147631), + new DateTimePoint(new DateTime(2023,8,30),149208), + new DateTimePoint(new DateTime(2023,8,31),151182), + new DateTimePoint(new DateTime(2023,9,1),154169), + new DateTimePoint(new DateTime(2023,9,2),156423), + new DateTimePoint(new DateTime(2023,9,3),158004), + new DateTimePoint(new DateTime(2023,9,4),159295), + new DateTimePoint(new DateTime(2023,9,5),160918), + new DateTimePoint(new DateTime(2023,9,6),162588), + new DateTimePoint(new DateTime(2023,9,7),165389), + new DateTimePoint(new DateTime(2023,9,8),167249), + new DateTimePoint(new DateTime(2023,9,9),168114), + new DateTimePoint(new DateTime(2023,9,10),169359), + new DateTimePoint(new DateTime(2023,9,11),170632), + new DateTimePoint(new DateTime(2023,9,12),172253), + new DateTimePoint(new DateTime(2023,9,13),173469), + new DateTimePoint(new DateTime(2023,9,14),175070), + new DateTimePoint(new DateTime(2023,9,15),178989), + new DateTimePoint(new DateTime(2023,9,16),181458), + new DateTimePoint(new DateTime(2023,9,17),183897), + new DateTimePoint(new DateTime(2023,9,18),187075), + new DateTimePoint(new DateTime(2023,9,19),189310), + new DateTimePoint(new DateTime(2023,9,20),191222), + new DateTimePoint(new DateTime(2023,9,21),193085), + new DateTimePoint(new DateTime(2023,9,22),194400), + new DateTimePoint(new DateTime(2023,9,23),195840), + new DateTimePoint(new DateTime(2023,9,24),197150), + new DateTimePoint(new DateTime(2023,9,25),198977), + new DateTimePoint(new DateTime(2023,9,26),200761), + new DateTimePoint(new DateTime(2023,9,27),202386), + new DateTimePoint(new DateTime(2023,9,28),204423), + new DateTimePoint(new DateTime(2023,9,29),205933), + new DateTimePoint(new DateTime(2023,9,30),208147), + new DateTimePoint(new DateTime(2023,10,1),211839), + new DateTimePoint(new DateTime(2023,10,2),214020), + new DateTimePoint(new DateTime(2023,10,3),215108), + new DateTimePoint(new DateTime(2023,10,4),216143), + new DateTimePoint(new DateTime(2023,10,5),217237), + new DateTimePoint(new DateTime(2023,10,6),219079), + new DateTimePoint(new DateTime(2023,10,7),220265), + new DateTimePoint(new DateTime(2023,10,8),221840), + new DateTimePoint(new DateTime(2023,10,9),222991), + new DateTimePoint(new DateTime(2023,10,10),223956), + new DateTimePoint(new DateTime(2023,10,11),225196), + new DateTimePoint(new DateTime(2023,10,12),226953), + new DateTimePoint(new DateTime(2023,10,13),228353), + new DateTimePoint(new DateTime(2023,10,14),230155), + new DateTimePoint(new DateTime(2023,10,15),231394), + new DateTimePoint(new DateTime(2023,10,16),233000), + new DateTimePoint(new DateTime(2023,10,17),234315), + new DateTimePoint(new DateTime(2023,10,18),235664), + new DateTimePoint(new DateTime(2023,10,19),236815), + new DateTimePoint(new DateTime(2023,10,20),238053), + new DateTimePoint(new DateTime(2023,10,21),239242), + new DateTimePoint(new DateTime(2023,10,22),240559), + new DateTimePoint(new DateTime(2023,10,23),241874), + new DateTimePoint(new DateTime(2023,10,24),243325), + new DateTimePoint(new DateTime(2023,10,25),244500), + new DateTimePoint(new DateTime(2023,10,26),245782), + new DateTimePoint(new DateTime(2023,10,27),246890), + new DateTimePoint(new DateTime(2023,10,28),248279), + new DateTimePoint(new DateTime(2023,10,29),249430), + new DateTimePoint(new DateTime(2023,10,30),250786), + new DateTimePoint(new DateTime(2023,10,31),252469), + new DateTimePoint(new DateTime(2023,11,1),254329), + new DateTimePoint(new DateTime(2023,11,2),255527), + new DateTimePoint(new DateTime(2023,11,3),256871), + new DateTimePoint(new DateTime(2023,11,4),258273), + new DateTimePoint(new DateTime(2023,11,5),259765), + new DateTimePoint(new DateTime(2023,11,6),261310), + new DateTimePoint(new DateTime(2023,11,7),262735), + new DateTimePoint(new DateTime(2023,11,8),264093), + new DateTimePoint(new DateTime(2023,11,9),265408), + new DateTimePoint(new DateTime(2023,11,10),267776), + new DateTimePoint(new DateTime(2023,11,11),269474), + } } - }, - new LineSeries + }; + } + + public override byte[] DownloadChartData() + { + var totalSerie = Series[0].As>(); + var prizeSerie = Series[1].As>(); + + var totalSerieValues = totalSerie.Values.ToList(); + var prizeSerieValues = prizeSerie.Values.ToList(); + var records = new List(); + + for (int i = 0; i < totalSerieValues.Count(); i++) { - Name = "Total Lucky Draws prizes [$]", - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - Fill = null, - Stroke = new SolidColorPaint(Colors.SerieRed,4), - GeometryStroke = null, - GeometrySize = 0, - LineSmoothness = 1, - ScalesXAt = 0, - ScalesYAt = 1, // it will be scaled at the Axis[0] instance - Values = new List + records.Add(new CsvData { - new DateTimePoint(new DateTime(2023,7,20),0), - new DateTimePoint(new DateTime(2023,7,21),0), - new DateTimePoint(new DateTime(2023,7,24),14439), - new DateTimePoint(new DateTime(2023,7,25),26623), - new DateTimePoint(new DateTime(2023,7,26),37487), - new DateTimePoint(new DateTime(2023,7,27),49260), - new DateTimePoint(new DateTime(2023,7,28),57117), - new DateTimePoint(new DateTime(2023,7,29),60569), - new DateTimePoint(new DateTime(2023,7,30),63479), - new DateTimePoint(new DateTime(2023,7,31),66678), - new DateTimePoint(new DateTime(2023,8,1),71342), - new DateTimePoint(new DateTime(2023,8,2),75631), - new DateTimePoint(new DateTime(2023,8,3),78755), - new DateTimePoint(new DateTime(2023,8,4),81707), - new DateTimePoint(new DateTime(2023,8,5),85189), - new DateTimePoint(new DateTime(2023,8,6),88533), - new DateTimePoint(new DateTime(2023,8,7),91386), - new DateTimePoint(new DateTime(2023,8,8),93638), - new DateTimePoint(new DateTime(2023,8,9),96115), - new DateTimePoint(new DateTime(2023,8,10),97941), - new DateTimePoint(new DateTime(2023,8,11),101287), - new DateTimePoint(new DateTime(2023,8,12),103554), - new DateTimePoint(new DateTime(2023,8,13),106446), - new DateTimePoint(new DateTime(2023,8,14),109445), - new DateTimePoint(new DateTime(2023,8,15),112440), - new DateTimePoint(new DateTime(2023,8,16),114680), - new DateTimePoint(new DateTime(2023,8,17),117211), - new DateTimePoint(new DateTime(2023,8,18),119511), - new DateTimePoint(new DateTime(2023,8,19),122601), - new DateTimePoint(new DateTime(2023,8,20),125299), - new DateTimePoint(new DateTime(2023,8,21),128234), - new DateTimePoint(new DateTime(2023,8,22),131295), - new DateTimePoint(new DateTime(2023,8,23),133901), - new DateTimePoint(new DateTime(2023,8,24),137287), - new DateTimePoint(new DateTime(2023,8,25),139551), - new DateTimePoint(new DateTime(2023,8,26),141997), - new DateTimePoint(new DateTime(2023,8,27),143405), - new DateTimePoint(new DateTime(2023,8,28),145491), - new DateTimePoint(new DateTime(2023,8,29),147631), - new DateTimePoint(new DateTime(2023,8,30),149208), - new DateTimePoint(new DateTime(2023,8,31),151182), - new DateTimePoint(new DateTime(2023,9,1),154169), - new DateTimePoint(new DateTime(2023,9,2),156423), - new DateTimePoint(new DateTime(2023,9,3),158004), - new DateTimePoint(new DateTime(2023,9,4),159295), - new DateTimePoint(new DateTime(2023,9,5),160918), - new DateTimePoint(new DateTime(2023,9,6),162588), - new DateTimePoint(new DateTime(2023,9,7),165389), - new DateTimePoint(new DateTime(2023,9,8),167249), - new DateTimePoint(new DateTime(2023,9,9),168114), - new DateTimePoint(new DateTime(2023,9,10),169359), - new DateTimePoint(new DateTime(2023,9,11),170632), - new DateTimePoint(new DateTime(2023,9,12),172253), - new DateTimePoint(new DateTime(2023,9,13),173469), - new DateTimePoint(new DateTime(2023,9,14),175070), - new DateTimePoint(new DateTime(2023,9,15),178989), - new DateTimePoint(new DateTime(2023,9,16),181458), - new DateTimePoint(new DateTime(2023,9,17),183897), - new DateTimePoint(new DateTime(2023,9,18),187075), - new DateTimePoint(new DateTime(2023,9,19),189310), - new DateTimePoint(new DateTime(2023,9,20),191222), - new DateTimePoint(new DateTime(2023,9,21),193085), - new DateTimePoint(new DateTime(2023,9,22),194400), - new DateTimePoint(new DateTime(2023,9,23),195840), - new DateTimePoint(new DateTime(2023,9,24),197150), - new DateTimePoint(new DateTime(2023,9,25),198977), - new DateTimePoint(new DateTime(2023,9,26),200761), - new DateTimePoint(new DateTime(2023,9,27),202386), - new DateTimePoint(new DateTime(2023,9,28),204423), - new DateTimePoint(new DateTime(2023,9,29),205933), - new DateTimePoint(new DateTime(2023,9,30),208147), - new DateTimePoint(new DateTime(2023,10,1),211839), - new DateTimePoint(new DateTime(2023,10,2),214020), - new DateTimePoint(new DateTime(2023,10,3),215108), - new DateTimePoint(new DateTime(2023,10,4),216143), - new DateTimePoint(new DateTime(2023,10,5),217237), - new DateTimePoint(new DateTime(2023,10,6),219079), - new DateTimePoint(new DateTime(2023,10,7),220265), - new DateTimePoint(new DateTime(2023,10,8),221840), - new DateTimePoint(new DateTime(2023,10,9),222991), - new DateTimePoint(new DateTime(2023,10,10),223956), - new DateTimePoint(new DateTime(2023,10,11),225196), - new DateTimePoint(new DateTime(2023,10,12),226953), - new DateTimePoint(new DateTime(2023,10,13),228353), - new DateTimePoint(new DateTime(2023,10,14),230155), - new DateTimePoint(new DateTime(2023,10,15),231394), - new DateTimePoint(new DateTime(2023,10,16),233000), - new DateTimePoint(new DateTime(2023,10,17),234315), - new DateTimePoint(new DateTime(2023,10,18),235664), - new DateTimePoint(new DateTime(2023,10,19),236815), - new DateTimePoint(new DateTime(2023,10,20),238053), - new DateTimePoint(new DateTime(2023,10,21),239242), - new DateTimePoint(new DateTime(2023,10,22),240559), - new DateTimePoint(new DateTime(2023,10,23),241874), - new DateTimePoint(new DateTime(2023,10,24),243325), - new DateTimePoint(new DateTime(2023,10,25),244500), - new DateTimePoint(new DateTime(2023,10,26),245782), - new DateTimePoint(new DateTime(2023,10,27),246890), - new DateTimePoint(new DateTime(2023,10,28),248279), - new DateTimePoint(new DateTime(2023,10,29),249430), - new DateTimePoint(new DateTime(2023,10,30),250786), - new DateTimePoint(new DateTime(2023,10,31),252469), - new DateTimePoint(new DateTime(2023,11,1),254329), - new DateTimePoint(new DateTime(2023,11,2),255527), - new DateTimePoint(new DateTime(2023,11,3),256871), - new DateTimePoint(new DateTime(2023,11,4),258273), - new DateTimePoint(new DateTime(2023,11,5),259765), - new DateTimePoint(new DateTime(2023,11,6),261310), - new DateTimePoint(new DateTime(2023,11,7),262735), - new DateTimePoint(new DateTime(2023,11,8),264093), - new DateTimePoint(new DateTime(2023,11,9),265408), - new DateTimePoint(new DateTime(2023,11,10),267776), - new DateTimePoint(new DateTime(2023,11,11),269474), - } + Date = totalSerieValues[i].DateTime, + TotaDraws = totalSerieValues[i].Value, + TotalPrizes = prizeSerieValues[i].Value, + }); } - }; + + using (var stream = new MemoryStream()) + using (var writer = new StreamWriter(stream)) + using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) + { + csv.WriteRecords(records); + writer.Flush(); + return stream.ToArray(); + } + } + + private class CsvData + { + public DateTime Date { get; set; } + public double? TotalPrizes { get; set; } + public double? TotaDraws { get; set; } + } } } diff --git a/DeBankUI/Shared/Michal/LuckyDrawsWinnersHistogram.razor.cs b/DeBankUI/Shared/Michal/LuckyDrawsWinnersHistogram.razor.cs index e0c8500..0fd91ed 100644 --- a/DeBankUI/Shared/Michal/LuckyDrawsWinnersHistogram.razor.cs +++ b/DeBankUI/Shared/Michal/LuckyDrawsWinnersHistogram.razor.cs @@ -1,51 +1,84 @@ -using DeBankUI.Components; +using CsvHelper; +using DeBankUI.Components; using DeBankUI.Utils; using LiveChartsCore; using LiveChartsCore.Defaults; using LiveChartsCore.SkiaSharpView; using LiveChartsCore.SkiaSharpView.Painting; +using MudBlazor.Extensions; using SkiaSharp; +using System.Globalization; namespace DeBankUI.Shared.Michal { public partial class LuckyDrawsWinnersHistogram : BaseChartComponent { private static readonly SKColor black = SKColors.Black; - private DrawMarginFrame DrawMarginFrame => new() - { - Fill = new SolidColorPaint(Colors.ChartBackground), - Stroke = new SolidColorPaint(Colors.ChartBorder, 2) - }; - public ISeries[] Series { get; set; } = + public LuckyDrawsWinnersHistogram() { - new ColumnSeries + YAxes = new[] + { + new Axis + { + Name = "Number of unique winners", + MinLimit = 0, + } + }; + + XAxes = new[] + { + new Axis + { + Name = "Number of wins", + Labels = new string[] { "1", "2", "3-5", "5-10", "10-25", "25-50", ">50" }, + LabelsRotation = 0, + SeparatorsAtCenter = false, + ForceStepToMin = true, + } + }; + + Series = new[] { - Name = "Number of Lucky Draws winners", - Values = new double[] { 15354, 3461, 3012, 2786, 2228, 586, 363}, - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - }, - }; + new ColumnSeries + { + Name = "Number of Lucky Draws winners", + Values = new int[] { 15354, 3461, 3012, 2786, 2228, 586, 363}, + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), + }, + }; + } - public Axis[] YAxes { get; set; } = + public override byte[] DownloadChartData() { - new Axis + var columnSerie = Series[0].As>(); + var columnSerieValues = columnSerie.Values.ToList(); + var columnSerieCategories = XAxes[0].Labels.ToList(); + var records = new List(); + + for (int i = 0; i < columnSerie.Values.Count(); i++) { - Name = "Number of unique winners", - MinLimit = 0, + records.Add(new CsvData + { + NumberOfWinners = columnSerieValues[i], + NumberOfWins = columnSerieCategories[i], + }); } - }; - public Axis[] XAxes { get; set; } = - { - new Axis + using (var stream = new MemoryStream()) + using (var writer = new StreamWriter(stream)) + using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) { - Name = "Number of wins", - Labels = new string[] { "1", "2", "3-5", "5-10", "10-25", "25-50", ">50" }, - LabelsRotation = 0, - SeparatorsAtCenter = false, - ForceStepToMin = true, + csv.WriteRecords(records); + writer.Flush(); + return stream.ToArray(); } - }; + } + + private class CsvData + { + public string? NumberOfWins { get; set; } + public int? NumberOfWinners { get; set; } + } } } diff --git a/DeBankUI/Shared/Michal/OfficialProfileRegistrationsChart.razor.cs b/DeBankUI/Shared/Michal/OfficialProfileRegistrationsChart.razor.cs index 0b6415b..e87d58c 100644 --- a/DeBankUI/Shared/Michal/OfficialProfileRegistrationsChart.razor.cs +++ b/DeBankUI/Shared/Michal/OfficialProfileRegistrationsChart.razor.cs @@ -1,207 +1,238 @@ -using DeBankUI.Components; +using CsvHelper; +using DeBankUI.Components; using DeBankUI.Utils; using LiveChartsCore; using LiveChartsCore.Defaults; using LiveChartsCore.SkiaSharpView; using LiveChartsCore.SkiaSharpView.Painting; +using MudBlazor.Extensions; using SkiaSharp; +using System.Globalization; namespace DeBankUI.Shared.Michal { public partial class OfficialProfileRegistrationsChart : BaseChartComponent { private static readonly SKColor black = SKColors.Black; - private DrawMarginFrame DrawMarginFrame => new() - { - Fill = new SolidColorPaint(Colors.ChartBackground), - Stroke = new SolidColorPaint(Colors.ChartBorder, 2) - }; - private Axis[] XAxes { get; set; } = + public OfficialProfileRegistrationsChart() { - new DateTimeAxis(TimeSpan.FromDays(1), date => date.ToString("yyyy-MM-dd")) + XAxes = new[] { - LabelsRotation = 30, - TicksPaint = new SolidColorPaint(black), - NamePaint = new SolidColorPaint(black), - LabelsPaint = new SolidColorPaint(black), - } - }; + new DateTimeAxis(TimeSpan.FromDays(1), date => date.ToString("yyyy-MM-dd")) + { + LabelsRotation = 30, + TicksPaint = new SolidColorPaint(black), + NamePaint = new SolidColorPaint(black), + LabelsPaint = new SolidColorPaint(black), + } + }; - private Axis[] YAxes { get; set; } = - { - new Axis + YAxes = new[] { - Name = "Number of Official Profiles", - NamePaint = new SolidColorPaint(Colors.SerieBlue), - LabelsPaint = new SolidColorPaint(Colors.SerieBlue), - TicksPaint = new SolidColorPaint(Colors.SerieBlue), - SubticksPaint = new SolidColorPaint(Colors.SerieBlue), - }, - }; + new Axis + { + Name = "Number of Official Profiles", + NamePaint = new SolidColorPaint(Colors.SerieBlue), + LabelsPaint = new SolidColorPaint(Colors.SerieBlue), + TicksPaint = new SolidColorPaint(Colors.SerieBlue), + SubticksPaint = new SolidColorPaint(Colors.SerieBlue), + }, + }; + Series = new[] + { + new LineSeries + { + Name = "Official profiles", + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), + Stroke = new SolidColorPaint(Colors.SerieBlue,4), + GeometryStroke = null, + GeometrySize = 0, + Fill = null, + LineSmoothness = 1, + ScalesXAt = 0, + Values = new List + { + new DateTimePoint(new DateTime(2023,2,9),3), + new DateTimePoint(new DateTime(2023,2,22),4), + new DateTimePoint(new DateTime(2023,2,24),5), + new DateTimePoint(new DateTime(2023,2,28),6), + new DateTimePoint(new DateTime(2023,3,6),8), + new DateTimePoint(new DateTime(2023,3,14),9), + new DateTimePoint(new DateTime(2023,3,17),10), + new DateTimePoint(new DateTime(2023,3,22),11), + new DateTimePoint(new DateTime(2023,3,23),12), + new DateTimePoint(new DateTime(2023,3,26),13), + new DateTimePoint(new DateTime(2023,3,27),14), + new DateTimePoint(new DateTime(2023,3,29),15), + new DateTimePoint(new DateTime(2023,4,14),17), + new DateTimePoint(new DateTime(2023,4,17),18), + new DateTimePoint(new DateTime(2023,4,27),19), + new DateTimePoint(new DateTime(2023,4,29),20), + new DateTimePoint(new DateTime(2023,5,6),21), + new DateTimePoint(new DateTime(2023,5,8),22), + new DateTimePoint(new DateTime(2023,5,13),23), + new DateTimePoint(new DateTime(2023,5,18),24), + new DateTimePoint(new DateTime(2023,5,21),25), + new DateTimePoint(new DateTime(2023,5,23),27), + new DateTimePoint(new DateTime(2023,5,25),28), + new DateTimePoint(new DateTime(2023,5,26),31), + new DateTimePoint(new DateTime(2023,5,27),32), + new DateTimePoint(new DateTime(2023,5,29),34), + new DateTimePoint(new DateTime(2023,5,30),35), + new DateTimePoint(new DateTime(2023,5,31),37), + new DateTimePoint(new DateTime(2023,6,2),39), + new DateTimePoint(new DateTime(2023,6,3),40), + new DateTimePoint(new DateTime(2023,6,4),41), + new DateTimePoint(new DateTime(2023,6,6),42), + new DateTimePoint(new DateTime(2023,6,8),43), + new DateTimePoint(new DateTime(2023,6,9),44), + new DateTimePoint(new DateTime(2023,6,15),45), + new DateTimePoint(new DateTime(2023,6,18),46), + new DateTimePoint(new DateTime(2023,6,19),48), + new DateTimePoint(new DateTime(2023,6,20),49), + new DateTimePoint(new DateTime(2023,6,23),51), + new DateTimePoint(new DateTime(2023,6,24),52), + new DateTimePoint(new DateTime(2023,6,26),53), + new DateTimePoint(new DateTime(2023,6,27),55), + new DateTimePoint(new DateTime(2023,6,28),57), + new DateTimePoint(new DateTime(2023,6,30),58), + new DateTimePoint(new DateTime(2023,7,2),59), + new DateTimePoint(new DateTime(2023,7,5),60), + new DateTimePoint(new DateTime(2023,7,6),62), + new DateTimePoint(new DateTime(2023,7,7),63), + new DateTimePoint(new DateTime(2023,7,10),64), + new DateTimePoint(new DateTime(2023,7,12),65), + new DateTimePoint(new DateTime(2023,7,13),66), + new DateTimePoint(new DateTime(2023,7,16),67), + new DateTimePoint(new DateTime(2023,7,17),69), + new DateTimePoint(new DateTime(2023,7,18),71), + new DateTimePoint(new DateTime(2023,7,20),73), + new DateTimePoint(new DateTime(2023,7,22),74), + new DateTimePoint(new DateTime(2023,7,23),76), + new DateTimePoint(new DateTime(2023,7,24),79), + new DateTimePoint(new DateTime(2023,7,25),83), + new DateTimePoint(new DateTime(2023,7,26),84), + new DateTimePoint(new DateTime(2023,7,27),88), + new DateTimePoint(new DateTime(2023,7,30),91), + new DateTimePoint(new DateTime(2023,7,31),93), + new DateTimePoint(new DateTime(2023,8,1),94), + new DateTimePoint(new DateTime(2023,8,2),101), + new DateTimePoint(new DateTime(2023,8,3),104), + new DateTimePoint(new DateTime(2023,8,4),105), + new DateTimePoint(new DateTime(2023,8,5),106), + new DateTimePoint(new DateTime(2023,8,6),107), + new DateTimePoint(new DateTime(2023,8,9),113), + new DateTimePoint(new DateTime(2023,8,10),115), + new DateTimePoint(new DateTime(2023,8,11),117), + new DateTimePoint(new DateTime(2023,8,12),118), + new DateTimePoint(new DateTime(2023,8,13),120), + new DateTimePoint(new DateTime(2023,8,14),122), + new DateTimePoint(new DateTime(2023,8,15),123), + new DateTimePoint(new DateTime(2023,8,16),126), + new DateTimePoint(new DateTime(2023,8,17),128), + new DateTimePoint(new DateTime(2023,8,18),131), + new DateTimePoint(new DateTime(2023,8,19),132), + new DateTimePoint(new DateTime(2023,8,21),137), + new DateTimePoint(new DateTime(2023,8,22),138), + new DateTimePoint(new DateTime(2023,8,23),141), + new DateTimePoint(new DateTime(2023,8,24),142), + new DateTimePoint(new DateTime(2023,8,25),143), + new DateTimePoint(new DateTime(2023,8,26),144), + new DateTimePoint(new DateTime(2023,8,27),145), + new DateTimePoint(new DateTime(2023,8,28),147), + new DateTimePoint(new DateTime(2023,8,29),150), + new DateTimePoint(new DateTime(2023,8,30),151), + new DateTimePoint(new DateTime(2023,8,31),154), + new DateTimePoint(new DateTime(2023,9,1),156), + new DateTimePoint(new DateTime(2023,9,4),157), + new DateTimePoint(new DateTime(2023,9,5),160), + new DateTimePoint(new DateTime(2023,9,6),162), + new DateTimePoint(new DateTime(2023,9,7),165), + new DateTimePoint(new DateTime(2023,9,8),169), + new DateTimePoint(new DateTime(2023,9,11),172), + new DateTimePoint(new DateTime(2023,9,13),175), + new DateTimePoint(new DateTime(2023,9,15),176), + new DateTimePoint(new DateTime(2023,9,16),177), + new DateTimePoint(new DateTime(2023,9,17),178), + new DateTimePoint(new DateTime(2023,9,18),179), + new DateTimePoint(new DateTime(2023,9,19),180), + new DateTimePoint(new DateTime(2023,9,20),183), + new DateTimePoint(new DateTime(2023,9,21),185), + new DateTimePoint(new DateTime(2023,9,22),186), + new DateTimePoint(new DateTime(2023,9,23),187), + new DateTimePoint(new DateTime(2023,9,25),189), + new DateTimePoint(new DateTime(2023,9,27),191), + new DateTimePoint(new DateTime(2023,9,28),192), + new DateTimePoint(new DateTime(2023,10,2),195), + new DateTimePoint(new DateTime(2023,10,3),196), + new DateTimePoint(new DateTime(2023,10,4),198), + new DateTimePoint(new DateTime(2023,10,6),199), + new DateTimePoint(new DateTime(2023,10,7),200), + new DateTimePoint(new DateTime(2023,10,8),201), + new DateTimePoint(new DateTime(2023,10,10),204), + new DateTimePoint(new DateTime(2023,10,11),207), + new DateTimePoint(new DateTime(2023,10,13),208), + new DateTimePoint(new DateTime(2023,10,14),209), + new DateTimePoint(new DateTime(2023,10,15),210), + new DateTimePoint(new DateTime(2023,10,16),213), + new DateTimePoint(new DateTime(2023,10,17),217), + new DateTimePoint(new DateTime(2023,10,18),221), + new DateTimePoint(new DateTime(2023,10,19),225), + new DateTimePoint(new DateTime(2023,10,20),227), + new DateTimePoint(new DateTime(2023,10,22),228), + new DateTimePoint(new DateTime(2023,10,23),230), + new DateTimePoint(new DateTime(2023,10,24),235), + new DateTimePoint(new DateTime(2023,10,25),240), + new DateTimePoint(new DateTime(2023,10,26),246), + new DateTimePoint(new DateTime(2023,10,27),248), + new DateTimePoint(new DateTime(2023,10,28),250), + new DateTimePoint(new DateTime(2023,10,30),254), + new DateTimePoint(new DateTime(2023,10,31),256), + new DateTimePoint(new DateTime(2023,11,1),257), + new DateTimePoint(new DateTime(2023,11,3),258), + new DateTimePoint(new DateTime(2023,11,6),259), + new DateTimePoint(new DateTime(2023,11,7),262), + new DateTimePoint(new DateTime(2023,11,8),264), + new DateTimePoint(new DateTime(2023,11,10),268), + new DateTimePoint(new DateTime(2023,11,13),270), + new DateTimePoint(new DateTime(2023,11,15),271), + new DateTimePoint(new DateTime(2023,11,16),274), + } + }, + }; + } - private ISeries[] Series { get; set; } = + public override byte[] DownloadChartData() { - new LineSeries + var totalSerie = Series[0].As>(); + var totalSerieValues = totalSerie.Values.ToList(); + var records = new List(); + + for (int i = 0; i < totalSerie.Values.Count(); i++) { - Name = "Official profiles", - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - Stroke = new SolidColorPaint(Colors.SerieBlue,4), - GeometryStroke = null, - GeometrySize = 0, - Fill = null, - LineSmoothness = 1, - ScalesXAt = 0, - Values = new List + records.Add(new CsvData { - new DateTimePoint(new DateTime(2023,2,9),3), - new DateTimePoint(new DateTime(2023,2,22),4), - new DateTimePoint(new DateTime(2023,2,24),5), - new DateTimePoint(new DateTime(2023,2,28),6), - new DateTimePoint(new DateTime(2023,3,6),8), - new DateTimePoint(new DateTime(2023,3,14),9), - new DateTimePoint(new DateTime(2023,3,17),10), - new DateTimePoint(new DateTime(2023,3,22),11), - new DateTimePoint(new DateTime(2023,3,23),12), - new DateTimePoint(new DateTime(2023,3,26),13), - new DateTimePoint(new DateTime(2023,3,27),14), - new DateTimePoint(new DateTime(2023,3,29),15), - new DateTimePoint(new DateTime(2023,4,14),17), - new DateTimePoint(new DateTime(2023,4,17),18), - new DateTimePoint(new DateTime(2023,4,27),19), - new DateTimePoint(new DateTime(2023,4,29),20), - new DateTimePoint(new DateTime(2023,5,6),21), - new DateTimePoint(new DateTime(2023,5,8),22), - new DateTimePoint(new DateTime(2023,5,13),23), - new DateTimePoint(new DateTime(2023,5,18),24), - new DateTimePoint(new DateTime(2023,5,21),25), - new DateTimePoint(new DateTime(2023,5,23),27), - new DateTimePoint(new DateTime(2023,5,25),28), - new DateTimePoint(new DateTime(2023,5,26),31), - new DateTimePoint(new DateTime(2023,5,27),32), - new DateTimePoint(new DateTime(2023,5,29),34), - new DateTimePoint(new DateTime(2023,5,30),35), - new DateTimePoint(new DateTime(2023,5,31),37), - new DateTimePoint(new DateTime(2023,6,2),39), - new DateTimePoint(new DateTime(2023,6,3),40), - new DateTimePoint(new DateTime(2023,6,4),41), - new DateTimePoint(new DateTime(2023,6,6),42), - new DateTimePoint(new DateTime(2023,6,8),43), - new DateTimePoint(new DateTime(2023,6,9),44), - new DateTimePoint(new DateTime(2023,6,15),45), - new DateTimePoint(new DateTime(2023,6,18),46), - new DateTimePoint(new DateTime(2023,6,19),48), - new DateTimePoint(new DateTime(2023,6,20),49), - new DateTimePoint(new DateTime(2023,6,23),51), - new DateTimePoint(new DateTime(2023,6,24),52), - new DateTimePoint(new DateTime(2023,6,26),53), - new DateTimePoint(new DateTime(2023,6,27),55), - new DateTimePoint(new DateTime(2023,6,28),57), - new DateTimePoint(new DateTime(2023,6,30),58), - new DateTimePoint(new DateTime(2023,7,2),59), - new DateTimePoint(new DateTime(2023,7,5),60), - new DateTimePoint(new DateTime(2023,7,6),62), - new DateTimePoint(new DateTime(2023,7,7),63), - new DateTimePoint(new DateTime(2023,7,10),64), - new DateTimePoint(new DateTime(2023,7,12),65), - new DateTimePoint(new DateTime(2023,7,13),66), - new DateTimePoint(new DateTime(2023,7,16),67), - new DateTimePoint(new DateTime(2023,7,17),69), - new DateTimePoint(new DateTime(2023,7,18),71), - new DateTimePoint(new DateTime(2023,7,20),73), - new DateTimePoint(new DateTime(2023,7,22),74), - new DateTimePoint(new DateTime(2023,7,23),76), - new DateTimePoint(new DateTime(2023,7,24),79), - new DateTimePoint(new DateTime(2023,7,25),83), - new DateTimePoint(new DateTime(2023,7,26),84), - new DateTimePoint(new DateTime(2023,7,27),88), - new DateTimePoint(new DateTime(2023,7,30),91), - new DateTimePoint(new DateTime(2023,7,31),93), - new DateTimePoint(new DateTime(2023,8,1),94), - new DateTimePoint(new DateTime(2023,8,2),101), - new DateTimePoint(new DateTime(2023,8,3),104), - new DateTimePoint(new DateTime(2023,8,4),105), - new DateTimePoint(new DateTime(2023,8,5),106), - new DateTimePoint(new DateTime(2023,8,6),107), - new DateTimePoint(new DateTime(2023,8,9),113), - new DateTimePoint(new DateTime(2023,8,10),115), - new DateTimePoint(new DateTime(2023,8,11),117), - new DateTimePoint(new DateTime(2023,8,12),118), - new DateTimePoint(new DateTime(2023,8,13),120), - new DateTimePoint(new DateTime(2023,8,14),122), - new DateTimePoint(new DateTime(2023,8,15),123), - new DateTimePoint(new DateTime(2023,8,16),126), - new DateTimePoint(new DateTime(2023,8,17),128), - new DateTimePoint(new DateTime(2023,8,18),131), - new DateTimePoint(new DateTime(2023,8,19),132), - new DateTimePoint(new DateTime(2023,8,21),137), - new DateTimePoint(new DateTime(2023,8,22),138), - new DateTimePoint(new DateTime(2023,8,23),141), - new DateTimePoint(new DateTime(2023,8,24),142), - new DateTimePoint(new DateTime(2023,8,25),143), - new DateTimePoint(new DateTime(2023,8,26),144), - new DateTimePoint(new DateTime(2023,8,27),145), - new DateTimePoint(new DateTime(2023,8,28),147), - new DateTimePoint(new DateTime(2023,8,29),150), - new DateTimePoint(new DateTime(2023,8,30),151), - new DateTimePoint(new DateTime(2023,8,31),154), - new DateTimePoint(new DateTime(2023,9,1),156), - new DateTimePoint(new DateTime(2023,9,4),157), - new DateTimePoint(new DateTime(2023,9,5),160), - new DateTimePoint(new DateTime(2023,9,6),162), - new DateTimePoint(new DateTime(2023,9,7),165), - new DateTimePoint(new DateTime(2023,9,8),169), - new DateTimePoint(new DateTime(2023,9,11),172), - new DateTimePoint(new DateTime(2023,9,13),175), - new DateTimePoint(new DateTime(2023,9,15),176), - new DateTimePoint(new DateTime(2023,9,16),177), - new DateTimePoint(new DateTime(2023,9,17),178), - new DateTimePoint(new DateTime(2023,9,18),179), - new DateTimePoint(new DateTime(2023,9,19),180), - new DateTimePoint(new DateTime(2023,9,20),183), - new DateTimePoint(new DateTime(2023,9,21),185), - new DateTimePoint(new DateTime(2023,9,22),186), - new DateTimePoint(new DateTime(2023,9,23),187), - new DateTimePoint(new DateTime(2023,9,25),189), - new DateTimePoint(new DateTime(2023,9,27),191), - new DateTimePoint(new DateTime(2023,9,28),192), - new DateTimePoint(new DateTime(2023,10,2),195), - new DateTimePoint(new DateTime(2023,10,3),196), - new DateTimePoint(new DateTime(2023,10,4),198), - new DateTimePoint(new DateTime(2023,10,6),199), - new DateTimePoint(new DateTime(2023,10,7),200), - new DateTimePoint(new DateTime(2023,10,8),201), - new DateTimePoint(new DateTime(2023,10,10),204), - new DateTimePoint(new DateTime(2023,10,11),207), - new DateTimePoint(new DateTime(2023,10,13),208), - new DateTimePoint(new DateTime(2023,10,14),209), - new DateTimePoint(new DateTime(2023,10,15),210), - new DateTimePoint(new DateTime(2023,10,16),213), - new DateTimePoint(new DateTime(2023,10,17),217), - new DateTimePoint(new DateTime(2023,10,18),221), - new DateTimePoint(new DateTime(2023,10,19),225), - new DateTimePoint(new DateTime(2023,10,20),227), - new DateTimePoint(new DateTime(2023,10,22),228), - new DateTimePoint(new DateTime(2023,10,23),230), - new DateTimePoint(new DateTime(2023,10,24),235), - new DateTimePoint(new DateTime(2023,10,25),240), - new DateTimePoint(new DateTime(2023,10,26),246), - new DateTimePoint(new DateTime(2023,10,27),248), - new DateTimePoint(new DateTime(2023,10,28),250), - new DateTimePoint(new DateTime(2023,10,30),254), - new DateTimePoint(new DateTime(2023,10,31),256), - new DateTimePoint(new DateTime(2023,11,1),257), - new DateTimePoint(new DateTime(2023,11,3),258), - new DateTimePoint(new DateTime(2023,11,6),259), - new DateTimePoint(new DateTime(2023,11,7),262), - new DateTimePoint(new DateTime(2023,11,8),264), - new DateTimePoint(new DateTime(2023,11,10),268), - new DateTimePoint(new DateTime(2023,11,13),270), - new DateTimePoint(new DateTime(2023,11,15),271), - new DateTimePoint(new DateTime(2023,11,16),274), - } - }, - }; + Date = totalSerieValues[i].DateTime, + OfficialProfiles = totalSerieValues[i].Value, + }); + } + + using (var stream = new MemoryStream()) + using (var writer = new StreamWriter(stream)) + using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) + { + csv.WriteRecords(records); + writer.Flush(); + return stream.ToArray(); + } + } + + private class CsvData + { + public DateTime Date { get; set; } + public double? OfficialProfiles { get; set; } + } } } diff --git a/DeBankUI/Shared/Michal/RewardPoolsDailyChart.razor.cs b/DeBankUI/Shared/Michal/RewardPoolsDailyChart.razor.cs index 03a566f..a33ab75 100644 --- a/DeBankUI/Shared/Michal/RewardPoolsDailyChart.razor.cs +++ b/DeBankUI/Shared/Michal/RewardPoolsDailyChart.razor.cs @@ -1,398 +1,434 @@ -using DeBankUI.Components; +using CsvHelper; +using DeBankUI.Components; using DeBankUI.Utils; using LiveChartsCore; using LiveChartsCore.Defaults; using LiveChartsCore.SkiaSharpView; using LiveChartsCore.SkiaSharpView.Painting; +using MudBlazor.Extensions; using SkiaSharp; +using System.Globalization; namespace DeBankUI.Shared.Michal { public partial class RewardPoolsDailyChart : BaseChartComponent { private static readonly SKColor black = SKColors.Black; - private DrawMarginFrame DrawMarginFrame => new() - { - Fill = new SolidColorPaint(Colors.ChartBackground), - Stroke = new SolidColorPaint(Colors.ChartBorder, 2) - }; - private Axis[] XAxes { get; set; } = + public RewardPoolsDailyChart() { - new DateTimeAxis(TimeSpan.FromDays(1), date => date.ToString("yyyy-MM-dd")) + XAxes = new[] { - LabelsRotation = 30, - TicksPaint = new SolidColorPaint(black), - NamePaint = new SolidColorPaint(black), - LabelsPaint = new SolidColorPaint(black), - } - }; + new DateTimeAxis(TimeSpan.FromDays(1), date => date.ToString("yyyy-MM-dd")) + { + LabelsRotation = 30, + TicksPaint = new SolidColorPaint(black), + NamePaint = new SolidColorPaint(black), + LabelsPaint = new SolidColorPaint(black), + } + }; - private Axis[] YAxes { get; set; } = - { - new Axis - { - Name = "Daily number of Reward Pools", - NamePaint = new SolidColorPaint(Colors.SerieBlue), - LabelsPaint = new SolidColorPaint(Colors.SerieBlue), - TicksPaint = new SolidColorPaint(Colors.SerieBlue), - SubticksPaint = new SolidColorPaint(Colors.SerieBlue), - }, - new Axis + YAxes = new[] { - Name = "Daily Reward Pools prizes [$]", - ShowSeparatorLines = false, - Position = LiveChartsCore.Measure.AxisPosition.End, - NamePaint = new SolidColorPaint(Colors.SerieRed), - LabelsPaint = new SolidColorPaint(Colors.SerieRed), - TicksPaint = new SolidColorPaint(Colors.SerieRed), - SubticksPaint = new SolidColorPaint(Colors.SerieRed), - }, - }; - + new Axis + { + Name = "Daily number of Reward Pools", + NamePaint = new SolidColorPaint(Colors.SerieBlue), + LabelsPaint = new SolidColorPaint(Colors.SerieBlue), + TicksPaint = new SolidColorPaint(Colors.SerieBlue), + SubticksPaint = new SolidColorPaint(Colors.SerieBlue), + }, + new Axis + { + Name = "Daily Reward Pools prizes [$]", + ShowSeparatorLines = false, + Position = LiveChartsCore.Measure.AxisPosition.End, + NamePaint = new SolidColorPaint(Colors.SerieRed), + LabelsPaint = new SolidColorPaint(Colors.SerieRed), + TicksPaint = new SolidColorPaint(Colors.SerieRed), + SubticksPaint = new SolidColorPaint(Colors.SerieRed), + }, + }; - private ISeries[] Series { get; set; } = - { - new LineSeries + Series = new[] { - Name="Daily number of Reward Pools", - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - Stroke = new SolidColorPaint(Colors.SerieBlue,4), - GeometryStroke = null, - GeometrySize = 0, - Fill = null, - LineSmoothness = 1, - ScalesYAt = 0, // it will be scaled at the Axis[0] instance - ScalesXAt = 0, - Values = new List + new LineSeries + { + Name="Daily number of Reward Pools", + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), + Stroke = new SolidColorPaint(Colors.SerieBlue,4), + GeometryStroke = null, + GeometrySize = 0, + Fill = null, + LineSmoothness = 1, + ScalesYAt = 0, // it will be scaled at the Axis[0] instance + ScalesXAt = 0, + Values = new List + { + new DateTimePoint(new DateTime(2023,6,9),1), + new DateTimePoint(new DateTime(2023,6,11),13), + new DateTimePoint(new DateTime(2023,6,12),125), + new DateTimePoint(new DateTime(2023,6,13),91), + new DateTimePoint(new DateTime(2023,6,14),212), + new DateTimePoint(new DateTime(2023,6,15),230), + new DateTimePoint(new DateTime(2023,6,16),257), + new DateTimePoint(new DateTime(2023,6,17),148), + new DateTimePoint(new DateTime(2023,6,18),94), + new DateTimePoint(new DateTime(2023,6,19),112), + new DateTimePoint(new DateTime(2023,6,20),174), + new DateTimePoint(new DateTime(2023,6,21),169), + new DateTimePoint(new DateTime(2023,6,22),270), + new DateTimePoint(new DateTime(2023,6,23),168), + new DateTimePoint(new DateTime(2023,6,24),90), + new DateTimePoint(new DateTime(2023,6,25),91), + new DateTimePoint(new DateTime(2023,6,26),142), + new DateTimePoint(new DateTime(2023,6,27),422), + new DateTimePoint(new DateTime(2023,6,28),116), + new DateTimePoint(new DateTime(2023,6,29),134), + new DateTimePoint(new DateTime(2023,6,30),163), + new DateTimePoint(new DateTime(2023,7,1),272), + new DateTimePoint(new DateTime(2023,7,2),181), + new DateTimePoint(new DateTime(2023,7,3),205), + new DateTimePoint(new DateTime(2023,7,4),391), + new DateTimePoint(new DateTime(2023,7,5),411), + new DateTimePoint(new DateTime(2023,7,6),366), + new DateTimePoint(new DateTime(2023,7,7),171), + new DateTimePoint(new DateTime(2023,7,8),134), + new DateTimePoint(new DateTime(2023,7,9),139), + new DateTimePoint(new DateTime(2023,7,10),191), + new DateTimePoint(new DateTime(2023,7,11),222), + new DateTimePoint(new DateTime(2023,7,12),205), + new DateTimePoint(new DateTime(2023,7,13),264), + new DateTimePoint(new DateTime(2023,7,14),449), + new DateTimePoint(new DateTime(2023,7,15),293), + new DateTimePoint(new DateTime(2023,7,16),277), + new DateTimePoint(new DateTime(2023,7,17),315), + new DateTimePoint(new DateTime(2023,7,18),297), + new DateTimePoint(new DateTime(2023,7,19),446), + new DateTimePoint(new DateTime(2023,7,20),614), + new DateTimePoint(new DateTime(2023,7,21),638), + new DateTimePoint(new DateTime(2023,7,22),701), + new DateTimePoint(new DateTime(2023,7,23),810), + new DateTimePoint(new DateTime(2023,7,24),1305), + new DateTimePoint(new DateTime(2023,7,25),1194), + new DateTimePoint(new DateTime(2023,7,26),1383), + new DateTimePoint(new DateTime(2023,7,27),1422), + new DateTimePoint(new DateTime(2023,7,28),1334), + new DateTimePoint(new DateTime(2023,7,29),976), + new DateTimePoint(new DateTime(2023,7,30),960), + new DateTimePoint(new DateTime(2023,7,31),1086), + new DateTimePoint(new DateTime(2023,8,1),1144), + new DateTimePoint(new DateTime(2023,8,2),1159), + new DateTimePoint(new DateTime(2023,8,3),1075), + new DateTimePoint(new DateTime(2023,8,4),1220), + new DateTimePoint(new DateTime(2023,8,5),957), + new DateTimePoint(new DateTime(2023,8,6),900), + new DateTimePoint(new DateTime(2023,8,7),1232), + new DateTimePoint(new DateTime(2023,8,8),1301), + new DateTimePoint(new DateTime(2023,8,9),1270), + new DateTimePoint(new DateTime(2023,8,10),1076), + new DateTimePoint(new DateTime(2023,8,11),1191), + new DateTimePoint(new DateTime(2023,8,12),913), + new DateTimePoint(new DateTime(2023,8,13),769), + new DateTimePoint(new DateTime(2023,8,14),996), + new DateTimePoint(new DateTime(2023,8,15),918), + new DateTimePoint(new DateTime(2023,8,16),812), + new DateTimePoint(new DateTime(2023,8,17),802), + new DateTimePoint(new DateTime(2023,8,18),709), + new DateTimePoint(new DateTime(2023,8,19),745), + new DateTimePoint(new DateTime(2023,8,20),755), + new DateTimePoint(new DateTime(2023,8,21),779), + new DateTimePoint(new DateTime(2023,8,22),756), + new DateTimePoint(new DateTime(2023,8,23),659), + new DateTimePoint(new DateTime(2023,8,24),701), + new DateTimePoint(new DateTime(2023,8,25),625), + new DateTimePoint(new DateTime(2023,8,26),593), + new DateTimePoint(new DateTime(2023,8,27),547), + new DateTimePoint(new DateTime(2023,8,28),633), + new DateTimePoint(new DateTime(2023,8,29),647), + new DateTimePoint(new DateTime(2023,8,30),577), + new DateTimePoint(new DateTime(2023,8,31),569), + new DateTimePoint(new DateTime(2023,9,1),537), + new DateTimePoint(new DateTime(2023,9,2),505), + new DateTimePoint(new DateTime(2023,9,3),505), + new DateTimePoint(new DateTime(2023,9,4),556), + new DateTimePoint(new DateTime(2023,9,5),578), + new DateTimePoint(new DateTime(2023,9,6),529), + new DateTimePoint(new DateTime(2023,9,7),613), + new DateTimePoint(new DateTime(2023,9,8),496), + new DateTimePoint(new DateTime(2023,9,9),401), + new DateTimePoint(new DateTime(2023,9,10),426), + new DateTimePoint(new DateTime(2023,9,11),496), + new DateTimePoint(new DateTime(2023,9,12),456), + new DateTimePoint(new DateTime(2023,9,13),497), + new DateTimePoint(new DateTime(2023,9,14),573), + new DateTimePoint(new DateTime(2023,9,15),933), + new DateTimePoint(new DateTime(2023,9,16),648), + new DateTimePoint(new DateTime(2023,9,17),589), + new DateTimePoint(new DateTime(2023,9,18),809), + new DateTimePoint(new DateTime(2023,9,19),777), + new DateTimePoint(new DateTime(2023,9,20),711), + new DateTimePoint(new DateTime(2023,9,21),596), + new DateTimePoint(new DateTime(2023,9,22),697), + new DateTimePoint(new DateTime(2023,9,23),626), + new DateTimePoint(new DateTime(2023,9,24),526), + new DateTimePoint(new DateTime(2023,9,25),624), + new DateTimePoint(new DateTime(2023,9,26),669), + new DateTimePoint(new DateTime(2023,9,27),817), + new DateTimePoint(new DateTime(2023,9,28),715), + new DateTimePoint(new DateTime(2023,9,29),801), + new DateTimePoint(new DateTime(2023,9,30),710), + new DateTimePoint(new DateTime(2023,10,1),761), + new DateTimePoint(new DateTime(2023,10,2),850), + new DateTimePoint(new DateTime(2023,10,3),796), + new DateTimePoint(new DateTime(2023,10,4),842), + new DateTimePoint(new DateTime(2023,10,5),778), + new DateTimePoint(new DateTime(2023,10,6),820), + new DateTimePoint(new DateTime(2023,10,7),748), + new DateTimePoint(new DateTime(2023,10,8),631), + new DateTimePoint(new DateTime(2023,10,9),784), + new DateTimePoint(new DateTime(2023,10,10),893), + new DateTimePoint(new DateTime(2023,10,11),984), + new DateTimePoint(new DateTime(2023,10,12),1077), + new DateTimePoint(new DateTime(2023,10,13),1064), + new DateTimePoint(new DateTime(2023,10,14),1008), + new DateTimePoint(new DateTime(2023,10,15),1496), + new DateTimePoint(new DateTime(2023,10,16),1235), + new DateTimePoint(new DateTime(2023,10,17),1021), + new DateTimePoint(new DateTime(2023,10,18),1072), + new DateTimePoint(new DateTime(2023,10,19),965), + new DateTimePoint(new DateTime(2023,10,20),1140), + new DateTimePoint(new DateTime(2023,10,21),1113), + new DateTimePoint(new DateTime(2023,10,22),1091), + new DateTimePoint(new DateTime(2023,10,23),1274), + new DateTimePoint(new DateTime(2023,10,24),1239), + new DateTimePoint(new DateTime(2023,10,25),1307), + new DateTimePoint(new DateTime(2023,10,26),1068), + new DateTimePoint(new DateTime(2023,10,27),1100), + new DateTimePoint(new DateTime(2023,10,28),1107), + new DateTimePoint(new DateTime(2023,10,29),1000), + new DateTimePoint(new DateTime(2023,10,30),1225), + new DateTimePoint(new DateTime(2023,10,31),1181), + new DateTimePoint(new DateTime(2023,11,1),1073), + new DateTimePoint(new DateTime(2023,11,2),1136), + new DateTimePoint(new DateTime(2023,11,3),1309), + new DateTimePoint(new DateTime(2023,11,4),1300), + new DateTimePoint(new DateTime(2023,11,5),1218), + new DateTimePoint(new DateTime(2023,11,6),1425), + new DateTimePoint(new DateTime(2023,11,7),1316), + new DateTimePoint(new DateTime(2023,11,8),1357), + new DateTimePoint(new DateTime(2023,11,9),1447), + new DateTimePoint(new DateTime(2023,11,10),1433), + new DateTimePoint(new DateTime(2023,11,11),1182), + } + }, + new LineSeries { - new DateTimePoint(new DateTime(2023,6,9),1), - new DateTimePoint(new DateTime(2023,6,11),13), - new DateTimePoint(new DateTime(2023,6,12),125), - new DateTimePoint(new DateTime(2023,6,13),91), - new DateTimePoint(new DateTime(2023,6,14),212), - new DateTimePoint(new DateTime(2023,6,15),230), - new DateTimePoint(new DateTime(2023,6,16),257), - new DateTimePoint(new DateTime(2023,6,17),148), - new DateTimePoint(new DateTime(2023,6,18),94), - new DateTimePoint(new DateTime(2023,6,19),112), - new DateTimePoint(new DateTime(2023,6,20),174), - new DateTimePoint(new DateTime(2023,6,21),169), - new DateTimePoint(new DateTime(2023,6,22),270), - new DateTimePoint(new DateTime(2023,6,23),168), - new DateTimePoint(new DateTime(2023,6,24),90), - new DateTimePoint(new DateTime(2023,6,25),91), - new DateTimePoint(new DateTime(2023,6,26),142), - new DateTimePoint(new DateTime(2023,6,27),422), - new DateTimePoint(new DateTime(2023,6,28),116), - new DateTimePoint(new DateTime(2023,6,29),134), - new DateTimePoint(new DateTime(2023,6,30),163), - new DateTimePoint(new DateTime(2023,7,1),272), - new DateTimePoint(new DateTime(2023,7,2),181), - new DateTimePoint(new DateTime(2023,7,3),205), - new DateTimePoint(new DateTime(2023,7,4),391), - new DateTimePoint(new DateTime(2023,7,5),411), - new DateTimePoint(new DateTime(2023,7,6),366), - new DateTimePoint(new DateTime(2023,7,7),171), - new DateTimePoint(new DateTime(2023,7,8),134), - new DateTimePoint(new DateTime(2023,7,9),139), - new DateTimePoint(new DateTime(2023,7,10),191), - new DateTimePoint(new DateTime(2023,7,11),222), - new DateTimePoint(new DateTime(2023,7,12),205), - new DateTimePoint(new DateTime(2023,7,13),264), - new DateTimePoint(new DateTime(2023,7,14),449), - new DateTimePoint(new DateTime(2023,7,15),293), - new DateTimePoint(new DateTime(2023,7,16),277), - new DateTimePoint(new DateTime(2023,7,17),315), - new DateTimePoint(new DateTime(2023,7,18),297), - new DateTimePoint(new DateTime(2023,7,19),446), - new DateTimePoint(new DateTime(2023,7,20),614), - new DateTimePoint(new DateTime(2023,7,21),638), - new DateTimePoint(new DateTime(2023,7,22),701), - new DateTimePoint(new DateTime(2023,7,23),810), - new DateTimePoint(new DateTime(2023,7,24),1305), - new DateTimePoint(new DateTime(2023,7,25),1194), - new DateTimePoint(new DateTime(2023,7,26),1383), - new DateTimePoint(new DateTime(2023,7,27),1422), - new DateTimePoint(new DateTime(2023,7,28),1334), - new DateTimePoint(new DateTime(2023,7,29),976), - new DateTimePoint(new DateTime(2023,7,30),960), - new DateTimePoint(new DateTime(2023,7,31),1086), - new DateTimePoint(new DateTime(2023,8,1),1144), - new DateTimePoint(new DateTime(2023,8,2),1159), - new DateTimePoint(new DateTime(2023,8,3),1075), - new DateTimePoint(new DateTime(2023,8,4),1220), - new DateTimePoint(new DateTime(2023,8,5),957), - new DateTimePoint(new DateTime(2023,8,6),900), - new DateTimePoint(new DateTime(2023,8,7),1232), - new DateTimePoint(new DateTime(2023,8,8),1301), - new DateTimePoint(new DateTime(2023,8,9),1270), - new DateTimePoint(new DateTime(2023,8,10),1076), - new DateTimePoint(new DateTime(2023,8,11),1191), - new DateTimePoint(new DateTime(2023,8,12),913), - new DateTimePoint(new DateTime(2023,8,13),769), - new DateTimePoint(new DateTime(2023,8,14),996), - new DateTimePoint(new DateTime(2023,8,15),918), - new DateTimePoint(new DateTime(2023,8,16),812), - new DateTimePoint(new DateTime(2023,8,17),802), - new DateTimePoint(new DateTime(2023,8,18),709), - new DateTimePoint(new DateTime(2023,8,19),745), - new DateTimePoint(new DateTime(2023,8,20),755), - new DateTimePoint(new DateTime(2023,8,21),779), - new DateTimePoint(new DateTime(2023,8,22),756), - new DateTimePoint(new DateTime(2023,8,23),659), - new DateTimePoint(new DateTime(2023,8,24),701), - new DateTimePoint(new DateTime(2023,8,25),625), - new DateTimePoint(new DateTime(2023,8,26),593), - new DateTimePoint(new DateTime(2023,8,27),547), - new DateTimePoint(new DateTime(2023,8,28),633), - new DateTimePoint(new DateTime(2023,8,29),647), - new DateTimePoint(new DateTime(2023,8,30),577), - new DateTimePoint(new DateTime(2023,8,31),569), - new DateTimePoint(new DateTime(2023,9,1),537), - new DateTimePoint(new DateTime(2023,9,2),505), - new DateTimePoint(new DateTime(2023,9,3),505), - new DateTimePoint(new DateTime(2023,9,4),556), - new DateTimePoint(new DateTime(2023,9,5),578), - new DateTimePoint(new DateTime(2023,9,6),529), - new DateTimePoint(new DateTime(2023,9,7),613), - new DateTimePoint(new DateTime(2023,9,8),496), - new DateTimePoint(new DateTime(2023,9,9),401), - new DateTimePoint(new DateTime(2023,9,10),426), - new DateTimePoint(new DateTime(2023,9,11),496), - new DateTimePoint(new DateTime(2023,9,12),456), - new DateTimePoint(new DateTime(2023,9,13),497), - new DateTimePoint(new DateTime(2023,9,14),573), - new DateTimePoint(new DateTime(2023,9,15),933), - new DateTimePoint(new DateTime(2023,9,16),648), - new DateTimePoint(new DateTime(2023,9,17),589), - new DateTimePoint(new DateTime(2023,9,18),809), - new DateTimePoint(new DateTime(2023,9,19),777), - new DateTimePoint(new DateTime(2023,9,20),711), - new DateTimePoint(new DateTime(2023,9,21),596), - new DateTimePoint(new DateTime(2023,9,22),697), - new DateTimePoint(new DateTime(2023,9,23),626), - new DateTimePoint(new DateTime(2023,9,24),526), - new DateTimePoint(new DateTime(2023,9,25),624), - new DateTimePoint(new DateTime(2023,9,26),669), - new DateTimePoint(new DateTime(2023,9,27),817), - new DateTimePoint(new DateTime(2023,9,28),715), - new DateTimePoint(new DateTime(2023,9,29),801), - new DateTimePoint(new DateTime(2023,9,30),710), - new DateTimePoint(new DateTime(2023,10,1),761), - new DateTimePoint(new DateTime(2023,10,2),850), - new DateTimePoint(new DateTime(2023,10,3),796), - new DateTimePoint(new DateTime(2023,10,4),842), - new DateTimePoint(new DateTime(2023,10,5),778), - new DateTimePoint(new DateTime(2023,10,6),820), - new DateTimePoint(new DateTime(2023,10,7),748), - new DateTimePoint(new DateTime(2023,10,8),631), - new DateTimePoint(new DateTime(2023,10,9),784), - new DateTimePoint(new DateTime(2023,10,10),893), - new DateTimePoint(new DateTime(2023,10,11),984), - new DateTimePoint(new DateTime(2023,10,12),1077), - new DateTimePoint(new DateTime(2023,10,13),1064), - new DateTimePoint(new DateTime(2023,10,14),1008), - new DateTimePoint(new DateTime(2023,10,15),1496), - new DateTimePoint(new DateTime(2023,10,16),1235), - new DateTimePoint(new DateTime(2023,10,17),1021), - new DateTimePoint(new DateTime(2023,10,18),1072), - new DateTimePoint(new DateTime(2023,10,19),965), - new DateTimePoint(new DateTime(2023,10,20),1140), - new DateTimePoint(new DateTime(2023,10,21),1113), - new DateTimePoint(new DateTime(2023,10,22),1091), - new DateTimePoint(new DateTime(2023,10,23),1274), - new DateTimePoint(new DateTime(2023,10,24),1239), - new DateTimePoint(new DateTime(2023,10,25),1307), - new DateTimePoint(new DateTime(2023,10,26),1068), - new DateTimePoint(new DateTime(2023,10,27),1100), - new DateTimePoint(new DateTime(2023,10,28),1107), - new DateTimePoint(new DateTime(2023,10,29),1000), - new DateTimePoint(new DateTime(2023,10,30),1225), - new DateTimePoint(new DateTime(2023,10,31),1181), - new DateTimePoint(new DateTime(2023,11,1),1073), - new DateTimePoint(new DateTime(2023,11,2),1136), - new DateTimePoint(new DateTime(2023,11,3),1309), - new DateTimePoint(new DateTime(2023,11,4),1300), - new DateTimePoint(new DateTime(2023,11,5),1218), - new DateTimePoint(new DateTime(2023,11,6),1425), - new DateTimePoint(new DateTime(2023,11,7),1316), - new DateTimePoint(new DateTime(2023,11,8),1357), - new DateTimePoint(new DateTime(2023,11,9),1447), - new DateTimePoint(new DateTime(2023,11,10),1433), - new DateTimePoint(new DateTime(2023,11,11),1182), + Name = "Daily Reward Pools prizes [$]", + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), + Fill = null, + Stroke = new SolidColorPaint(Colors.SerieRed,4), + GeometryStroke = null, + GeometrySize = 0, + LineSmoothness = 1, + ScalesXAt = 0, + ScalesYAt = 1, // it will be scaled at the Axis[0] instance + Values = new List + { + new DateTimePoint(new DateTime(2023,6,9),0), + new DateTimePoint(new DateTime(2023,6,11),2), + new DateTimePoint(new DateTime(2023,6,12),148), + new DateTimePoint(new DateTime(2023,6,13),541), + new DateTimePoint(new DateTime(2023,6,14),762), + new DateTimePoint(new DateTime(2023,6,15),188), + new DateTimePoint(new DateTime(2023,6,16),459), + new DateTimePoint(new DateTime(2023,6,17),271), + new DateTimePoint(new DateTime(2023,6,18),197), + new DateTimePoint(new DateTime(2023,6,19),346), + new DateTimePoint(new DateTime(2023,6,20),546), + new DateTimePoint(new DateTime(2023,6,21),384), + new DateTimePoint(new DateTime(2023,6,22),443), + new DateTimePoint(new DateTime(2023,6,23),157), + new DateTimePoint(new DateTime(2023,6,24),114), + new DateTimePoint(new DateTime(2023,6,25),74), + new DateTimePoint(new DateTime(2023,6,26),315), + new DateTimePoint(new DateTime(2023,6,27),207), + new DateTimePoint(new DateTime(2023,6,28),69), + new DateTimePoint(new DateTime(2023,6,29),78), + new DateTimePoint(new DateTime(2023,6,30),560), + new DateTimePoint(new DateTime(2023,7,1),674), + new DateTimePoint(new DateTime(2023,7,2),331), + new DateTimePoint(new DateTime(2023,7,3),490), + new DateTimePoint(new DateTime(2023,7,4),200), + new DateTimePoint(new DateTime(2023,7,5),378), + new DateTimePoint(new DateTime(2023,7,6),381), + new DateTimePoint(new DateTime(2023,7,7),1328), + new DateTimePoint(new DateTime(2023,7,8),402), + new DateTimePoint(new DateTime(2023,7,9),318), + new DateTimePoint(new DateTime(2023,7,10),532), + new DateTimePoint(new DateTime(2023,7,11),381), + new DateTimePoint(new DateTime(2023,7,12),485), + new DateTimePoint(new DateTime(2023,7,13),960), + new DateTimePoint(new DateTime(2023,7,14),2213), + new DateTimePoint(new DateTime(2023,7,15),1465), + new DateTimePoint(new DateTime(2023,7,16),1972), + new DateTimePoint(new DateTime(2023,7,17),2307), + new DateTimePoint(new DateTime(2023,7,18),1453), + new DateTimePoint(new DateTime(2023,7,19),2622), + new DateTimePoint(new DateTime(2023,7,20),2024), + new DateTimePoint(new DateTime(2023,7,21),2523), + new DateTimePoint(new DateTime(2023,7,22),1782), + new DateTimePoint(new DateTime(2023,7,23),2980), + new DateTimePoint(new DateTime(2023,7,24),4259), + new DateTimePoint(new DateTime(2023,7,25),3718), + new DateTimePoint(new DateTime(2023,7,26),4595), + new DateTimePoint(new DateTime(2023,7,27),7494), + new DateTimePoint(new DateTime(2023,7,28),12986), + new DateTimePoint(new DateTime(2023,7,29),2860), + new DateTimePoint(new DateTime(2023,7,30),3247), + new DateTimePoint(new DateTime(2023,7,31),1980), + new DateTimePoint(new DateTime(2023,8,1),2486), + new DateTimePoint(new DateTime(2023,8,2),4883), + new DateTimePoint(new DateTime(2023,8,3),2708), + new DateTimePoint(new DateTime(2023,8,4),2598), + new DateTimePoint(new DateTime(2023,8,5),1653), + new DateTimePoint(new DateTime(2023,8,6),1753), + new DateTimePoint(new DateTime(2023,8,7),3142), + new DateTimePoint(new DateTime(2023,8,8),2949), + new DateTimePoint(new DateTime(2023,8,9),3023), + new DateTimePoint(new DateTime(2023,8,10),2002), + new DateTimePoint(new DateTime(2023,8,11),2660), + new DateTimePoint(new DateTime(2023,8,12),2096), + new DateTimePoint(new DateTime(2023,8,13),2239), + new DateTimePoint(new DateTime(2023,8,14),4048), + new DateTimePoint(new DateTime(2023,8,15),1889), + new DateTimePoint(new DateTime(2023,8,16),2618), + new DateTimePoint(new DateTime(2023,8,17),2511), + new DateTimePoint(new DateTime(2023,8,18),2628), + new DateTimePoint(new DateTime(2023,8,19),1861), + new DateTimePoint(new DateTime(2023,8,20),2642), + new DateTimePoint(new DateTime(2023,8,21),1850), + new DateTimePoint(new DateTime(2023,8,22),2542), + new DateTimePoint(new DateTime(2023,8,23),2206), + new DateTimePoint(new DateTime(2023,8,24),1767), + new DateTimePoint(new DateTime(2023,8,25),2093), + new DateTimePoint(new DateTime(2023,8,26),1381), + new DateTimePoint(new DateTime(2023,8,27),1323), + new DateTimePoint(new DateTime(2023,8,28),1919), + new DateTimePoint(new DateTime(2023,8,29),1830), + new DateTimePoint(new DateTime(2023,8,30),1842), + new DateTimePoint(new DateTime(2023,8,31),1647), + new DateTimePoint(new DateTime(2023,9,1),2641), + new DateTimePoint(new DateTime(2023,9,2),1608), + new DateTimePoint(new DateTime(2023,9,3),1266), + new DateTimePoint(new DateTime(2023,9,4),1454), + new DateTimePoint(new DateTime(2023,9,5),1422), + new DateTimePoint(new DateTime(2023,9,6),1585), + new DateTimePoint(new DateTime(2023,9,7),2151), + new DateTimePoint(new DateTime(2023,9,8),1657), + new DateTimePoint(new DateTime(2023,9,9),949), + new DateTimePoint(new DateTime(2023,9,10),1064), + new DateTimePoint(new DateTime(2023,9,11),1223), + new DateTimePoint(new DateTime(2023,9,12),1413), + new DateTimePoint(new DateTime(2023,9,13),1244), + new DateTimePoint(new DateTime(2023,9,14),2774), + new DateTimePoint(new DateTime(2023,9,15),6585), + new DateTimePoint(new DateTime(2023,9,16),3305), + new DateTimePoint(new DateTime(2023,9,17),2425), + new DateTimePoint(new DateTime(2023,9,18),2461), + new DateTimePoint(new DateTime(2023,9,19),2085), + new DateTimePoint(new DateTime(2023,9,20),2239), + new DateTimePoint(new DateTime(2023,9,21),1772), + new DateTimePoint(new DateTime(2023,9,22),1856), + new DateTimePoint(new DateTime(2023,9,23),4037), + new DateTimePoint(new DateTime(2023,9,24),2915), + new DateTimePoint(new DateTime(2023,9,25),1758), + new DateTimePoint(new DateTime(2023,9,26),1752), + new DateTimePoint(new DateTime(2023,9,27),2953), + new DateTimePoint(new DateTime(2023,9,28),2393), + new DateTimePoint(new DateTime(2023,9,29),3282), + new DateTimePoint(new DateTime(2023,9,30),2393), + new DateTimePoint(new DateTime(2023,10,1),2859), + new DateTimePoint(new DateTime(2023,10,2),3342), + new DateTimePoint(new DateTime(2023,10,3),3011), + new DateTimePoint(new DateTime(2023,10,4),10471), + new DateTimePoint(new DateTime(2023,10,5),4503), + new DateTimePoint(new DateTime(2023,10,6),5294), + new DateTimePoint(new DateTime(2023,10,7),3547), + new DateTimePoint(new DateTime(2023,10,8),4054), + new DateTimePoint(new DateTime(2023,10,9),2880), + new DateTimePoint(new DateTime(2023,10,10),3272), + new DateTimePoint(new DateTime(2023,10,11),2580), + new DateTimePoint(new DateTime(2023,10,12),5956), + new DateTimePoint(new DateTime(2023,10,13),3874), + new DateTimePoint(new DateTime(2023,10,14),2756), + new DateTimePoint(new DateTime(2023,10,15),3451), + new DateTimePoint(new DateTime(2023,10,16),2552), + new DateTimePoint(new DateTime(2023,10,17),2904), + new DateTimePoint(new DateTime(2023,10,18),4441), + new DateTimePoint(new DateTime(2023,10,19),3445), + new DateTimePoint(new DateTime(2023,10,20),4816), + new DateTimePoint(new DateTime(2023,10,21),2839), + new DateTimePoint(new DateTime(2023,10,22),3034), + new DateTimePoint(new DateTime(2023,10,23),3459), + new DateTimePoint(new DateTime(2023,10,24),4110), + new DateTimePoint(new DateTime(2023,10,25),7376), + new DateTimePoint(new DateTime(2023,10,26),3005), + new DateTimePoint(new DateTime(2023,10,27),3183), + new DateTimePoint(new DateTime(2023,10,28),2794), + new DateTimePoint(new DateTime(2023,10,29),2660), + new DateTimePoint(new DateTime(2023,10,30),2778), + new DateTimePoint(new DateTime(2023,10,31),4507), + new DateTimePoint(new DateTime(2023,11,1),2640), + new DateTimePoint(new DateTime(2023,11,2),6128), + new DateTimePoint(new DateTime(2023,11,3),4050), + new DateTimePoint(new DateTime(2023,11,4),2942), + new DateTimePoint(new DateTime(2023,11,5),3548), + new DateTimePoint(new DateTime(2023,11,6),3775), + new DateTimePoint(new DateTime(2023,11,7),2939), + new DateTimePoint(new DateTime(2023,11,8),6437), + new DateTimePoint(new DateTime(2023,11,9),4286), + new DateTimePoint(new DateTime(2023,11,10),4875), + new DateTimePoint(new DateTime(2023,11,11),4538), + } } - }, - new LineSeries + }; + } + + public override byte[] DownloadChartData() + { + var dailySerie = Series[0].As>(); + var prizeSerie = Series[1].As>(); + + var dailySerieValues = dailySerie.Values.ToList(); + var prizeSerieValues = prizeSerie.Values.ToList(); + var records = new List(); + + for (int i = 0; i < dailySerieValues.Count(); i++) { - Name = "Daily Reward Pools prizes [$]", - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - Fill = null, - Stroke = new SolidColorPaint(Colors.SerieRed,4), - GeometryStroke = null, - GeometrySize = 0, - LineSmoothness = 1, - ScalesXAt = 0, - ScalesYAt = 1, // it will be scaled at the Axis[0] instance - Values = new List + records.Add(new CsvData { - new DateTimePoint(new DateTime(2023,6,9),0), - new DateTimePoint(new DateTime(2023,6,11),2), - new DateTimePoint(new DateTime(2023,6,12),148), - new DateTimePoint(new DateTime(2023,6,13),541), - new DateTimePoint(new DateTime(2023,6,14),762), - new DateTimePoint(new DateTime(2023,6,15),188), - new DateTimePoint(new DateTime(2023,6,16),459), - new DateTimePoint(new DateTime(2023,6,17),271), - new DateTimePoint(new DateTime(2023,6,18),197), - new DateTimePoint(new DateTime(2023,6,19),346), - new DateTimePoint(new DateTime(2023,6,20),546), - new DateTimePoint(new DateTime(2023,6,21),384), - new DateTimePoint(new DateTime(2023,6,22),443), - new DateTimePoint(new DateTime(2023,6,23),157), - new DateTimePoint(new DateTime(2023,6,24),114), - new DateTimePoint(new DateTime(2023,6,25),74), - new DateTimePoint(new DateTime(2023,6,26),315), - new DateTimePoint(new DateTime(2023,6,27),207), - new DateTimePoint(new DateTime(2023,6,28),69), - new DateTimePoint(new DateTime(2023,6,29),78), - new DateTimePoint(new DateTime(2023,6,30),560), - new DateTimePoint(new DateTime(2023,7,1),674), - new DateTimePoint(new DateTime(2023,7,2),331), - new DateTimePoint(new DateTime(2023,7,3),490), - new DateTimePoint(new DateTime(2023,7,4),200), - new DateTimePoint(new DateTime(2023,7,5),378), - new DateTimePoint(new DateTime(2023,7,6),381), - new DateTimePoint(new DateTime(2023,7,7),1328), - new DateTimePoint(new DateTime(2023,7,8),402), - new DateTimePoint(new DateTime(2023,7,9),318), - new DateTimePoint(new DateTime(2023,7,10),532), - new DateTimePoint(new DateTime(2023,7,11),381), - new DateTimePoint(new DateTime(2023,7,12),485), - new DateTimePoint(new DateTime(2023,7,13),960), - new DateTimePoint(new DateTime(2023,7,14),2213), - new DateTimePoint(new DateTime(2023,7,15),1465), - new DateTimePoint(new DateTime(2023,7,16),1972), - new DateTimePoint(new DateTime(2023,7,17),2307), - new DateTimePoint(new DateTime(2023,7,18),1453), - new DateTimePoint(new DateTime(2023,7,19),2622), - new DateTimePoint(new DateTime(2023,7,20),2024), - new DateTimePoint(new DateTime(2023,7,21),2523), - new DateTimePoint(new DateTime(2023,7,22),1782), - new DateTimePoint(new DateTime(2023,7,23),2980), - new DateTimePoint(new DateTime(2023,7,24),4259), - new DateTimePoint(new DateTime(2023,7,25),3718), - new DateTimePoint(new DateTime(2023,7,26),4595), - new DateTimePoint(new DateTime(2023,7,27),7494), - new DateTimePoint(new DateTime(2023,7,28),12986), - new DateTimePoint(new DateTime(2023,7,29),2860), - new DateTimePoint(new DateTime(2023,7,30),3247), - new DateTimePoint(new DateTime(2023,7,31),1980), - new DateTimePoint(new DateTime(2023,8,1),2486), - new DateTimePoint(new DateTime(2023,8,2),4883), - new DateTimePoint(new DateTime(2023,8,3),2708), - new DateTimePoint(new DateTime(2023,8,4),2598), - new DateTimePoint(new DateTime(2023,8,5),1653), - new DateTimePoint(new DateTime(2023,8,6),1753), - new DateTimePoint(new DateTime(2023,8,7),3142), - new DateTimePoint(new DateTime(2023,8,8),2949), - new DateTimePoint(new DateTime(2023,8,9),3023), - new DateTimePoint(new DateTime(2023,8,10),2002), - new DateTimePoint(new DateTime(2023,8,11),2660), - new DateTimePoint(new DateTime(2023,8,12),2096), - new DateTimePoint(new DateTime(2023,8,13),2239), - new DateTimePoint(new DateTime(2023,8,14),4048), - new DateTimePoint(new DateTime(2023,8,15),1889), - new DateTimePoint(new DateTime(2023,8,16),2618), - new DateTimePoint(new DateTime(2023,8,17),2511), - new DateTimePoint(new DateTime(2023,8,18),2628), - new DateTimePoint(new DateTime(2023,8,19),1861), - new DateTimePoint(new DateTime(2023,8,20),2642), - new DateTimePoint(new DateTime(2023,8,21),1850), - new DateTimePoint(new DateTime(2023,8,22),2542), - new DateTimePoint(new DateTime(2023,8,23),2206), - new DateTimePoint(new DateTime(2023,8,24),1767), - new DateTimePoint(new DateTime(2023,8,25),2093), - new DateTimePoint(new DateTime(2023,8,26),1381), - new DateTimePoint(new DateTime(2023,8,27),1323), - new DateTimePoint(new DateTime(2023,8,28),1919), - new DateTimePoint(new DateTime(2023,8,29),1830), - new DateTimePoint(new DateTime(2023,8,30),1842), - new DateTimePoint(new DateTime(2023,8,31),1647), - new DateTimePoint(new DateTime(2023,9,1),2641), - new DateTimePoint(new DateTime(2023,9,2),1608), - new DateTimePoint(new DateTime(2023,9,3),1266), - new DateTimePoint(new DateTime(2023,9,4),1454), - new DateTimePoint(new DateTime(2023,9,5),1422), - new DateTimePoint(new DateTime(2023,9,6),1585), - new DateTimePoint(new DateTime(2023,9,7),2151), - new DateTimePoint(new DateTime(2023,9,8),1657), - new DateTimePoint(new DateTime(2023,9,9),949), - new DateTimePoint(new DateTime(2023,9,10),1064), - new DateTimePoint(new DateTime(2023,9,11),1223), - new DateTimePoint(new DateTime(2023,9,12),1413), - new DateTimePoint(new DateTime(2023,9,13),1244), - new DateTimePoint(new DateTime(2023,9,14),2774), - new DateTimePoint(new DateTime(2023,9,15),6585), - new DateTimePoint(new DateTime(2023,9,16),3305), - new DateTimePoint(new DateTime(2023,9,17),2425), - new DateTimePoint(new DateTime(2023,9,18),2461), - new DateTimePoint(new DateTime(2023,9,19),2085), - new DateTimePoint(new DateTime(2023,9,20),2239), - new DateTimePoint(new DateTime(2023,9,21),1772), - new DateTimePoint(new DateTime(2023,9,22),1856), - new DateTimePoint(new DateTime(2023,9,23),4037), - new DateTimePoint(new DateTime(2023,9,24),2915), - new DateTimePoint(new DateTime(2023,9,25),1758), - new DateTimePoint(new DateTime(2023,9,26),1752), - new DateTimePoint(new DateTime(2023,9,27),2953), - new DateTimePoint(new DateTime(2023,9,28),2393), - new DateTimePoint(new DateTime(2023,9,29),3282), - new DateTimePoint(new DateTime(2023,9,30),2393), - new DateTimePoint(new DateTime(2023,10,1),2859), - new DateTimePoint(new DateTime(2023,10,2),3342), - new DateTimePoint(new DateTime(2023,10,3),3011), - new DateTimePoint(new DateTime(2023,10,4),10471), - new DateTimePoint(new DateTime(2023,10,5),4503), - new DateTimePoint(new DateTime(2023,10,6),5294), - new DateTimePoint(new DateTime(2023,10,7),3547), - new DateTimePoint(new DateTime(2023,10,8),4054), - new DateTimePoint(new DateTime(2023,10,9),2880), - new DateTimePoint(new DateTime(2023,10,10),3272), - new DateTimePoint(new DateTime(2023,10,11),2580), - new DateTimePoint(new DateTime(2023,10,12),5956), - new DateTimePoint(new DateTime(2023,10,13),3874), - new DateTimePoint(new DateTime(2023,10,14),2756), - new DateTimePoint(new DateTime(2023,10,15),3451), - new DateTimePoint(new DateTime(2023,10,16),2552), - new DateTimePoint(new DateTime(2023,10,17),2904), - new DateTimePoint(new DateTime(2023,10,18),4441), - new DateTimePoint(new DateTime(2023,10,19),3445), - new DateTimePoint(new DateTime(2023,10,20),4816), - new DateTimePoint(new DateTime(2023,10,21),2839), - new DateTimePoint(new DateTime(2023,10,22),3034), - new DateTimePoint(new DateTime(2023,10,23),3459), - new DateTimePoint(new DateTime(2023,10,24),4110), - new DateTimePoint(new DateTime(2023,10,25),7376), - new DateTimePoint(new DateTime(2023,10,26),3005), - new DateTimePoint(new DateTime(2023,10,27),3183), - new DateTimePoint(new DateTime(2023,10,28),2794), - new DateTimePoint(new DateTime(2023,10,29),2660), - new DateTimePoint(new DateTime(2023,10,30),2778), - new DateTimePoint(new DateTime(2023,10,31),4507), - new DateTimePoint(new DateTime(2023,11,1),2640), - new DateTimePoint(new DateTime(2023,11,2),6128), - new DateTimePoint(new DateTime(2023,11,3),4050), - new DateTimePoint(new DateTime(2023,11,4),2942), - new DateTimePoint(new DateTime(2023,11,5),3548), - new DateTimePoint(new DateTime(2023,11,6),3775), - new DateTimePoint(new DateTime(2023,11,7),2939), - new DateTimePoint(new DateTime(2023,11,8),6437), - new DateTimePoint(new DateTime(2023,11,9),4286), - new DateTimePoint(new DateTime(2023,11,10),4875), - new DateTimePoint(new DateTime(2023,11,11),4538), - } + Date = dailySerieValues[i].DateTime, + DailyRewardPools = dailySerieValues[i].Value, + DailyRewardPoolPrizes = prizeSerieValues[i].Value, + }); } - }; + + using (var stream = new MemoryStream()) + using (var writer = new StreamWriter(stream)) + using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) + { + csv.WriteRecords(records); + writer.Flush(); + return stream.ToArray(); + } + } + + private class CsvData + { + public DateTime Date { get; set; } + public double? DailyRewardPoolPrizes { get; set; } + public double? DailyRewardPools { get; set; } + } } } diff --git a/DeBankUI/Shared/Michal/RewardPoolsEarnersHistogram.razor.cs b/DeBankUI/Shared/Michal/RewardPoolsEarnersHistogram.razor.cs index 6f85a8c..8c53286 100644 --- a/DeBankUI/Shared/Michal/RewardPoolsEarnersHistogram.razor.cs +++ b/DeBankUI/Shared/Michal/RewardPoolsEarnersHistogram.razor.cs @@ -1,51 +1,84 @@ -using DeBankUI.Components; +using CsvHelper; +using DeBankUI.Components; using DeBankUI.Utils; using LiveChartsCore; using LiveChartsCore.Defaults; using LiveChartsCore.SkiaSharpView; using LiveChartsCore.SkiaSharpView.Painting; +using MudBlazor.Extensions; using SkiaSharp; +using System.Globalization; namespace DeBankUI.Shared.Michal { public partial class RewardPoolsEarnersHistogram : BaseChartComponent { private static readonly SKColor black = SKColors.Black; - private DrawMarginFrame DrawMarginFrame => new() - { - Fill = new SolidColorPaint(Colors.ChartBackground), - Stroke = new SolidColorPaint(Colors.ChartBorder, 2) - }; - public ISeries[] Series { get; set; } = + public RewardPoolsEarnersHistogram() { - new ColumnSeries + Series = new[] + { + new ColumnSeries + { + Name = "Number of Earners", + Values = new int[] { 13639, 108150, 161958, 154018, 79738, 30521, 16534, 14622, 4105, 1564 }, + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), + }, + }; + + YAxes = new[] { - Name = "Number of Earners", - Values = new double[] { 13639, 108150, 161958, 154018, 79738, 30521, 16534, 14622, 4105, 1564 }, - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - }, - }; + new Axis + { + Name = "Number of Earners", + MinLimit = 0, + } + }; + + XAxes = new[] + { + new Axis + { + Name = "Earnings from Rewar Pool", + Labels = new string[] { "$0.01", "$0.02", "$0.02-$0.05", "$0.05-$0.15", "$0.15-$0.5", "$0.5-$1", "$1-$2", "$2-$5", "$5-$10", ">$10" }, + LabelsRotation = 30, + SeparatorsAtCenter = false, + ForceStepToMin = true, + } + }; + } - public Axis[] YAxes { get; set; } = + public override byte[] DownloadChartData() { - new Axis + var columnSerie = Series[0].As>(); + var columnSerieValues = columnSerie.Values.ToList(); + var columnSerieCategories = XAxes[0].Labels.ToList(); + var records = new List(); + + for (int i = 0; i < columnSerie.Values.Count(); i++) { - Name = "Number of Earners", - MinLimit = 0, + records.Add(new CsvData + { + NumberOfEarners = columnSerieValues[i], + Earnings = columnSerieCategories[i], + }); } - }; - public Axis[] XAxes { get; set; } = - { - new Axis + using (var stream = new MemoryStream()) + using (var writer = new StreamWriter(stream)) + using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) + { + csv.WriteRecords(records); + writer.Flush(); + return stream.ToArray(); + } + } + + private class CsvData { - Name = "Earnings from Rewar Pool", - Labels = new string[] { "$0.01", "$0.02", "$0.02-$0.05", "$0.05-$0.15", "$0.15-$0.5", "$0.5-$1", "$1-$2", "$2-$5", "$5-$10", ">$10" }, - LabelsRotation = 30, - SeparatorsAtCenter = false, - ForceStepToMin = true, + public string? Earnings { get; set; } + public int? NumberOfEarners { get; set; } } - }; } } diff --git a/DeBankUI/Shared/Michal/RewardPoolsHistogram.razor.cs b/DeBankUI/Shared/Michal/RewardPoolsHistogram.razor.cs index a5a6e68..cd6353b 100644 --- a/DeBankUI/Shared/Michal/RewardPoolsHistogram.razor.cs +++ b/DeBankUI/Shared/Michal/RewardPoolsHistogram.razor.cs @@ -1,51 +1,84 @@ -using DeBankUI.Components; +using CsvHelper; +using DeBankUI.Components; using DeBankUI.Utils; using LiveChartsCore; using LiveChartsCore.Defaults; using LiveChartsCore.SkiaSharpView; using LiveChartsCore.SkiaSharpView.Painting; +using MudBlazor.Extensions; using SkiaSharp; +using System.Globalization; namespace DeBankUI.Shared.Michal { public partial class RewardPoolsHistogram : BaseChartComponent { private static readonly SKColor black = SKColors.Black; - private DrawMarginFrame DrawMarginFrame => new() - { - Fill = new SolidColorPaint(Colors.ChartBackground), - Stroke = new SolidColorPaint(Colors.ChartBorder, 2) - }; - public ISeries[] Series { get; set; } = + public RewardPoolsHistogram() { - new ColumnSeries + Series = new[] + { + new ColumnSeries + { + Name = "Number of Reward Pools", + Values = new int[] { 23887, 34654, 21373, 15555, 8726, 6490, 1754 }, + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), + }, + }; + + YAxes = new[] + { + new Axis + { + Name = "Number of Reward Pools", + MinLimit = 0, + } + }; + + XAxes = new[] { - Name = "Number of Reward Pools", - Values = new double[] { 23887, 34654, 21373, 15555, 8726, 6490, 1754 }, - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - }, - }; + new Axis + { + Name = "Prize in Reward Pool", + Labels = new string[] { "<$0.1", "$0.1-$1", "$1-$2", "$2-$5", "$5-$10", "$10-$25", ">$25" }, + LabelsRotation = 0, + SeparatorsAtCenter = false, + ForceStepToMin = true, + } + }; + } - public Axis[] YAxes { get; set; } = + public override byte[] DownloadChartData() { - new Axis + var columnSerie = Series[0].As>(); + var columnSerieValues = columnSerie.Values.ToList(); + var columnSerieCategories = XAxes[0].Labels.ToList(); + var records = new List(); + + for (int i = 0; i < columnSerie.Values.Count(); i++) { - Name = "Number of Reward Pools", - MinLimit = 0, + records.Add(new CsvData + { + NumberORewardPools = columnSerieValues[i], + PrizeInRewardPools = columnSerieCategories[i], + }); } - }; - public Axis[] XAxes { get; set; } = - { - new Axis + using (var stream = new MemoryStream()) + using (var writer = new StreamWriter(stream)) + using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) { - Name = "Prize in Reward Pool", - Labels = new string[] { "<$0.1", "$0.1-$1", "$1-$2", "$2-$5", "$5-$10", "$10-$25", ">$25" }, - LabelsRotation = 0, - SeparatorsAtCenter = false, - ForceStepToMin = true, + csv.WriteRecords(records); + writer.Flush(); + return stream.ToArray(); } - }; + } + + private class CsvData + { + public string? PrizeInRewardPools { get; set; } + public int? NumberORewardPools { get; set; } + } } } \ No newline at end of file diff --git a/DeBankUI/Shared/Michal/RewardPoolsTotalChart.razor.cs b/DeBankUI/Shared/Michal/RewardPoolsTotalChart.razor.cs index d5c72c7..1a26014 100644 --- a/DeBankUI/Shared/Michal/RewardPoolsTotalChart.razor.cs +++ b/DeBankUI/Shared/Michal/RewardPoolsTotalChart.razor.cs @@ -1,398 +1,434 @@ -using DeBankUI.Components; +using CsvHelper; +using DeBankUI.Components; using DeBankUI.Utils; using LiveChartsCore; using LiveChartsCore.Defaults; using LiveChartsCore.SkiaSharpView; using LiveChartsCore.SkiaSharpView.Painting; +using MudBlazor.Extensions; using SkiaSharp; +using System.Globalization; namespace DeBankUI.Shared.Michal { public partial class RewardPoolsTotalChart : BaseChartComponent { private static readonly SKColor black = SKColors.Black; - private DrawMarginFrame DrawMarginFrame => new() - { - Fill = new SolidColorPaint(Colors.ChartBackground), - Stroke = new SolidColorPaint(Colors.ChartBorder, 2) - }; - private Axis[] XAxes { get; set; } = + public RewardPoolsTotalChart() { - new DateTimeAxis(TimeSpan.FromDays(1), date => date.ToString("yyyy-MM-dd")) + XAxes = new[] { - LabelsRotation = 30, - TicksPaint = new SolidColorPaint(black), - NamePaint = new SolidColorPaint(black), - LabelsPaint = new SolidColorPaint(black), - } - }; + new DateTimeAxis(TimeSpan.FromDays(1), date => date.ToString("yyyy-MM-dd")) + { + LabelsRotation = 30, + TicksPaint = new SolidColorPaint(black), + NamePaint = new SolidColorPaint(black), + LabelsPaint = new SolidColorPaint(black), + } + }; - private Axis[] YAxes { get; set; } = - { - new Axis - { - Name = "Total number of Reward Pools", - NamePaint = new SolidColorPaint(Colors.SerieBlue), - LabelsPaint = new SolidColorPaint(Colors.SerieBlue), - TicksPaint = new SolidColorPaint(Colors.SerieBlue), - SubticksPaint = new SolidColorPaint(Colors.SerieBlue), - }, - new Axis + YAxes = new[] { - Name = "Total Reward Pools prizes [$]", - ShowSeparatorLines = false, - Position = LiveChartsCore.Measure.AxisPosition.End, - NamePaint = new SolidColorPaint(Colors.SerieRed), - LabelsPaint = new SolidColorPaint(Colors.SerieRed), - TicksPaint = new SolidColorPaint(Colors.SerieRed), - SubticksPaint = new SolidColorPaint(Colors.SerieRed), - }, - }; - + new Axis + { + Name = "Total number of Reward Pools", + NamePaint = new SolidColorPaint(Colors.SerieBlue), + LabelsPaint = new SolidColorPaint(Colors.SerieBlue), + TicksPaint = new SolidColorPaint(Colors.SerieBlue), + SubticksPaint = new SolidColorPaint(Colors.SerieBlue), + }, + new Axis + { + Name = "Total Reward Pools prizes [$]", + ShowSeparatorLines = false, + Position = LiveChartsCore.Measure.AxisPosition.End, + NamePaint = new SolidColorPaint(Colors.SerieRed), + LabelsPaint = new SolidColorPaint(Colors.SerieRed), + TicksPaint = new SolidColorPaint(Colors.SerieRed), + SubticksPaint = new SolidColorPaint(Colors.SerieRed), + }, + }; - private ISeries[] Series { get; set; } = - { - new LineSeries + Series = new[] { - Name = "Total number of Reward Pools", - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - Stroke = new SolidColorPaint(Colors.SerieBlue,4), - GeometryStroke = null, - GeometrySize = 0, - Fill = null, - LineSmoothness = 1, - ScalesYAt = 0, // it will be scaled at the Axis[0] instance - ScalesXAt = 0, - Values = new List + new LineSeries + { + Name = "Total number of Reward Pools", + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), + Stroke = new SolidColorPaint(Colors.SerieBlue,4), + GeometryStroke = null, + GeometrySize = 0, + Fill = null, + LineSmoothness = 1, + ScalesYAt = 0, // it will be scaled at the Axis[0] instance + ScalesXAt = 0, + Values = new List + { + new DateTimePoint(new DateTime(2023,6,9),1), + new DateTimePoint(new DateTime(2023,6,11),14), + new DateTimePoint(new DateTime(2023,6,12),139), + new DateTimePoint(new DateTime(2023,6,13),230), + new DateTimePoint(new DateTime(2023,6,14),442), + new DateTimePoint(new DateTime(2023,6,15),672), + new DateTimePoint(new DateTime(2023,6,16),929), + new DateTimePoint(new DateTime(2023,6,17),1077), + new DateTimePoint(new DateTime(2023,6,18),1171), + new DateTimePoint(new DateTime(2023,6,19),1283), + new DateTimePoint(new DateTime(2023,6,20),1457), + new DateTimePoint(new DateTime(2023,6,21),1626), + new DateTimePoint(new DateTime(2023,6,22),1896), + new DateTimePoint(new DateTime(2023,6,23),2064), + new DateTimePoint(new DateTime(2023,6,24),2154), + new DateTimePoint(new DateTime(2023,6,25),2245), + new DateTimePoint(new DateTime(2023,6,26),2387), + new DateTimePoint(new DateTime(2023,6,27),2809), + new DateTimePoint(new DateTime(2023,6,28),2925), + new DateTimePoint(new DateTime(2023,6,29),3059), + new DateTimePoint(new DateTime(2023,6,30),3222), + new DateTimePoint(new DateTime(2023,7,1),3494), + new DateTimePoint(new DateTime(2023,7,2),3675), + new DateTimePoint(new DateTime(2023,7,3),3880), + new DateTimePoint(new DateTime(2023,7,4),4271), + new DateTimePoint(new DateTime(2023,7,5),4682), + new DateTimePoint(new DateTime(2023,7,6),5048), + new DateTimePoint(new DateTime(2023,7,7),5219), + new DateTimePoint(new DateTime(2023,7,8),5353), + new DateTimePoint(new DateTime(2023,7,9),5492), + new DateTimePoint(new DateTime(2023,7,10),5683), + new DateTimePoint(new DateTime(2023,7,11),5905), + new DateTimePoint(new DateTime(2023,7,12),6110), + new DateTimePoint(new DateTime(2023,7,13),6374), + new DateTimePoint(new DateTime(2023,7,14),6823), + new DateTimePoint(new DateTime(2023,7,15),7116), + new DateTimePoint(new DateTime(2023,7,16),7393), + new DateTimePoint(new DateTime(2023,7,17),7708), + new DateTimePoint(new DateTime(2023,7,18),8005), + new DateTimePoint(new DateTime(2023,7,19),8451), + new DateTimePoint(new DateTime(2023,7,20),9065), + new DateTimePoint(new DateTime(2023,7,21),9703), + new DateTimePoint(new DateTime(2023,7,22),10404), + new DateTimePoint(new DateTime(2023,7,23),11214), + new DateTimePoint(new DateTime(2023,7,24),12519), + new DateTimePoint(new DateTime(2023,7,25),13713), + new DateTimePoint(new DateTime(2023,7,26),15096), + new DateTimePoint(new DateTime(2023,7,27),16518), + new DateTimePoint(new DateTime(2023,7,28),17852), + new DateTimePoint(new DateTime(2023,7,29),18828), + new DateTimePoint(new DateTime(2023,7,30),19788), + new DateTimePoint(new DateTime(2023,7,31),20874), + new DateTimePoint(new DateTime(2023,8,1),22018), + new DateTimePoint(new DateTime(2023,8,2),23177), + new DateTimePoint(new DateTime(2023,8,3),24252), + new DateTimePoint(new DateTime(2023,8,4),25472), + new DateTimePoint(new DateTime(2023,8,5),26429), + new DateTimePoint(new DateTime(2023,8,6),27329), + new DateTimePoint(new DateTime(2023,8,7),28561), + new DateTimePoint(new DateTime(2023,8,8),29862), + new DateTimePoint(new DateTime(2023,8,9),31132), + new DateTimePoint(new DateTime(2023,8,10),32208), + new DateTimePoint(new DateTime(2023,8,11),33399), + new DateTimePoint(new DateTime(2023,8,12),34312), + new DateTimePoint(new DateTime(2023,8,13),35081), + new DateTimePoint(new DateTime(2023,8,14),36077), + new DateTimePoint(new DateTime(2023,8,15),36995), + new DateTimePoint(new DateTime(2023,8,16),37807), + new DateTimePoint(new DateTime(2023,8,17),38609), + new DateTimePoint(new DateTime(2023,8,18),39318), + new DateTimePoint(new DateTime(2023,8,19),40063), + new DateTimePoint(new DateTime(2023,8,20),40818), + new DateTimePoint(new DateTime(2023,8,21),41597), + new DateTimePoint(new DateTime(2023,8,22),42353), + new DateTimePoint(new DateTime(2023,8,23),43012), + new DateTimePoint(new DateTime(2023,8,24),43713), + new DateTimePoint(new DateTime(2023,8,25),44338), + new DateTimePoint(new DateTime(2023,8,26),44931), + new DateTimePoint(new DateTime(2023,8,27),45478), + new DateTimePoint(new DateTime(2023,8,28),46111), + new DateTimePoint(new DateTime(2023,8,29),46758), + new DateTimePoint(new DateTime(2023,8,30),47335), + new DateTimePoint(new DateTime(2023,8,31),47904), + new DateTimePoint(new DateTime(2023,9,1),48441), + new DateTimePoint(new DateTime(2023,9,2),48946), + new DateTimePoint(new DateTime(2023,9,3),49451), + new DateTimePoint(new DateTime(2023,9,4),50007), + new DateTimePoint(new DateTime(2023,9,5),50585), + new DateTimePoint(new DateTime(2023,9,6),51114), + new DateTimePoint(new DateTime(2023,9,7),51727), + new DateTimePoint(new DateTime(2023,9,8),52223), + new DateTimePoint(new DateTime(2023,9,9),52624), + new DateTimePoint(new DateTime(2023,9,10),53050), + new DateTimePoint(new DateTime(2023,9,11),53546), + new DateTimePoint(new DateTime(2023,9,12),54002), + new DateTimePoint(new DateTime(2023,9,13),54499), + new DateTimePoint(new DateTime(2023,9,14),55072), + new DateTimePoint(new DateTime(2023,9,15),56005), + new DateTimePoint(new DateTime(2023,9,16),56653), + new DateTimePoint(new DateTime(2023,9,17),57242), + new DateTimePoint(new DateTime(2023,9,18),58051), + new DateTimePoint(new DateTime(2023,9,19),58828), + new DateTimePoint(new DateTime(2023,9,20),59539), + new DateTimePoint(new DateTime(2023,9,21),60135), + new DateTimePoint(new DateTime(2023,9,22),60832), + new DateTimePoint(new DateTime(2023,9,23),61458), + new DateTimePoint(new DateTime(2023,9,24),61984), + new DateTimePoint(new DateTime(2023,9,25),62608), + new DateTimePoint(new DateTime(2023,9,26),63277), + new DateTimePoint(new DateTime(2023,9,27),64094), + new DateTimePoint(new DateTime(2023,9,28),64809), + new DateTimePoint(new DateTime(2023,9,29),65610), + new DateTimePoint(new DateTime(2023,9,30),66320), + new DateTimePoint(new DateTime(2023,10,1),67081), + new DateTimePoint(new DateTime(2023,10,2),67931), + new DateTimePoint(new DateTime(2023,10,3),68727), + new DateTimePoint(new DateTime(2023,10,4),69569), + new DateTimePoint(new DateTime(2023,10,5),70347), + new DateTimePoint(new DateTime(2023,10,6),71167), + new DateTimePoint(new DateTime(2023,10,7),71915), + new DateTimePoint(new DateTime(2023,10,8),72546), + new DateTimePoint(new DateTime(2023,10,9),73330), + new DateTimePoint(new DateTime(2023,10,10),74223), + new DateTimePoint(new DateTime(2023,10,11),75207), + new DateTimePoint(new DateTime(2023,10,12),76284), + new DateTimePoint(new DateTime(2023,10,13),77348), + new DateTimePoint(new DateTime(2023,10,14),78356), + new DateTimePoint(new DateTime(2023,10,15),79852), + new DateTimePoint(new DateTime(2023,10,16),81087), + new DateTimePoint(new DateTime(2023,10,17),82108), + new DateTimePoint(new DateTime(2023,10,18),83180), + new DateTimePoint(new DateTime(2023,10,19),84145), + new DateTimePoint(new DateTime(2023,10,20),85285), + new DateTimePoint(new DateTime(2023,10,21),86398), + new DateTimePoint(new DateTime(2023,10,22),87489), + new DateTimePoint(new DateTime(2023,10,23),88763), + new DateTimePoint(new DateTime(2023,10,24),90002), + new DateTimePoint(new DateTime(2023,10,25),91309), + new DateTimePoint(new DateTime(2023,10,26),92377), + new DateTimePoint(new DateTime(2023,10,27),93477), + new DateTimePoint(new DateTime(2023,10,28),94584), + new DateTimePoint(new DateTime(2023,10,29),95584), + new DateTimePoint(new DateTime(2023,10,30),96809), + new DateTimePoint(new DateTime(2023,10,31),97990), + new DateTimePoint(new DateTime(2023,11,1),99063), + new DateTimePoint(new DateTime(2023,11,2),100199), + new DateTimePoint(new DateTime(2023,11,3),101508), + new DateTimePoint(new DateTime(2023,11,4),102808), + new DateTimePoint(new DateTime(2023,11,5),104026), + new DateTimePoint(new DateTime(2023,11,6),105451), + new DateTimePoint(new DateTime(2023,11,7),106767), + new DateTimePoint(new DateTime(2023,11,8),108124), + new DateTimePoint(new DateTime(2023,11,9),109571), + new DateTimePoint(new DateTime(2023,11,10),111004), + new DateTimePoint(new DateTime(2023,11,11),112186), + } + }, + new LineSeries { - new DateTimePoint(new DateTime(2023,6,9),1), - new DateTimePoint(new DateTime(2023,6,11),14), - new DateTimePoint(new DateTime(2023,6,12),139), - new DateTimePoint(new DateTime(2023,6,13),230), - new DateTimePoint(new DateTime(2023,6,14),442), - new DateTimePoint(new DateTime(2023,6,15),672), - new DateTimePoint(new DateTime(2023,6,16),929), - new DateTimePoint(new DateTime(2023,6,17),1077), - new DateTimePoint(new DateTime(2023,6,18),1171), - new DateTimePoint(new DateTime(2023,6,19),1283), - new DateTimePoint(new DateTime(2023,6,20),1457), - new DateTimePoint(new DateTime(2023,6,21),1626), - new DateTimePoint(new DateTime(2023,6,22),1896), - new DateTimePoint(new DateTime(2023,6,23),2064), - new DateTimePoint(new DateTime(2023,6,24),2154), - new DateTimePoint(new DateTime(2023,6,25),2245), - new DateTimePoint(new DateTime(2023,6,26),2387), - new DateTimePoint(new DateTime(2023,6,27),2809), - new DateTimePoint(new DateTime(2023,6,28),2925), - new DateTimePoint(new DateTime(2023,6,29),3059), - new DateTimePoint(new DateTime(2023,6,30),3222), - new DateTimePoint(new DateTime(2023,7,1),3494), - new DateTimePoint(new DateTime(2023,7,2),3675), - new DateTimePoint(new DateTime(2023,7,3),3880), - new DateTimePoint(new DateTime(2023,7,4),4271), - new DateTimePoint(new DateTime(2023,7,5),4682), - new DateTimePoint(new DateTime(2023,7,6),5048), - new DateTimePoint(new DateTime(2023,7,7),5219), - new DateTimePoint(new DateTime(2023,7,8),5353), - new DateTimePoint(new DateTime(2023,7,9),5492), - new DateTimePoint(new DateTime(2023,7,10),5683), - new DateTimePoint(new DateTime(2023,7,11),5905), - new DateTimePoint(new DateTime(2023,7,12),6110), - new DateTimePoint(new DateTime(2023,7,13),6374), - new DateTimePoint(new DateTime(2023,7,14),6823), - new DateTimePoint(new DateTime(2023,7,15),7116), - new DateTimePoint(new DateTime(2023,7,16),7393), - new DateTimePoint(new DateTime(2023,7,17),7708), - new DateTimePoint(new DateTime(2023,7,18),8005), - new DateTimePoint(new DateTime(2023,7,19),8451), - new DateTimePoint(new DateTime(2023,7,20),9065), - new DateTimePoint(new DateTime(2023,7,21),9703), - new DateTimePoint(new DateTime(2023,7,22),10404), - new DateTimePoint(new DateTime(2023,7,23),11214), - new DateTimePoint(new DateTime(2023,7,24),12519), - new DateTimePoint(new DateTime(2023,7,25),13713), - new DateTimePoint(new DateTime(2023,7,26),15096), - new DateTimePoint(new DateTime(2023,7,27),16518), - new DateTimePoint(new DateTime(2023,7,28),17852), - new DateTimePoint(new DateTime(2023,7,29),18828), - new DateTimePoint(new DateTime(2023,7,30),19788), - new DateTimePoint(new DateTime(2023,7,31),20874), - new DateTimePoint(new DateTime(2023,8,1),22018), - new DateTimePoint(new DateTime(2023,8,2),23177), - new DateTimePoint(new DateTime(2023,8,3),24252), - new DateTimePoint(new DateTime(2023,8,4),25472), - new DateTimePoint(new DateTime(2023,8,5),26429), - new DateTimePoint(new DateTime(2023,8,6),27329), - new DateTimePoint(new DateTime(2023,8,7),28561), - new DateTimePoint(new DateTime(2023,8,8),29862), - new DateTimePoint(new DateTime(2023,8,9),31132), - new DateTimePoint(new DateTime(2023,8,10),32208), - new DateTimePoint(new DateTime(2023,8,11),33399), - new DateTimePoint(new DateTime(2023,8,12),34312), - new DateTimePoint(new DateTime(2023,8,13),35081), - new DateTimePoint(new DateTime(2023,8,14),36077), - new DateTimePoint(new DateTime(2023,8,15),36995), - new DateTimePoint(new DateTime(2023,8,16),37807), - new DateTimePoint(new DateTime(2023,8,17),38609), - new DateTimePoint(new DateTime(2023,8,18),39318), - new DateTimePoint(new DateTime(2023,8,19),40063), - new DateTimePoint(new DateTime(2023,8,20),40818), - new DateTimePoint(new DateTime(2023,8,21),41597), - new DateTimePoint(new DateTime(2023,8,22),42353), - new DateTimePoint(new DateTime(2023,8,23),43012), - new DateTimePoint(new DateTime(2023,8,24),43713), - new DateTimePoint(new DateTime(2023,8,25),44338), - new DateTimePoint(new DateTime(2023,8,26),44931), - new DateTimePoint(new DateTime(2023,8,27),45478), - new DateTimePoint(new DateTime(2023,8,28),46111), - new DateTimePoint(new DateTime(2023,8,29),46758), - new DateTimePoint(new DateTime(2023,8,30),47335), - new DateTimePoint(new DateTime(2023,8,31),47904), - new DateTimePoint(new DateTime(2023,9,1),48441), - new DateTimePoint(new DateTime(2023,9,2),48946), - new DateTimePoint(new DateTime(2023,9,3),49451), - new DateTimePoint(new DateTime(2023,9,4),50007), - new DateTimePoint(new DateTime(2023,9,5),50585), - new DateTimePoint(new DateTime(2023,9,6),51114), - new DateTimePoint(new DateTime(2023,9,7),51727), - new DateTimePoint(new DateTime(2023,9,8),52223), - new DateTimePoint(new DateTime(2023,9,9),52624), - new DateTimePoint(new DateTime(2023,9,10),53050), - new DateTimePoint(new DateTime(2023,9,11),53546), - new DateTimePoint(new DateTime(2023,9,12),54002), - new DateTimePoint(new DateTime(2023,9,13),54499), - new DateTimePoint(new DateTime(2023,9,14),55072), - new DateTimePoint(new DateTime(2023,9,15),56005), - new DateTimePoint(new DateTime(2023,9,16),56653), - new DateTimePoint(new DateTime(2023,9,17),57242), - new DateTimePoint(new DateTime(2023,9,18),58051), - new DateTimePoint(new DateTime(2023,9,19),58828), - new DateTimePoint(new DateTime(2023,9,20),59539), - new DateTimePoint(new DateTime(2023,9,21),60135), - new DateTimePoint(new DateTime(2023,9,22),60832), - new DateTimePoint(new DateTime(2023,9,23),61458), - new DateTimePoint(new DateTime(2023,9,24),61984), - new DateTimePoint(new DateTime(2023,9,25),62608), - new DateTimePoint(new DateTime(2023,9,26),63277), - new DateTimePoint(new DateTime(2023,9,27),64094), - new DateTimePoint(new DateTime(2023,9,28),64809), - new DateTimePoint(new DateTime(2023,9,29),65610), - new DateTimePoint(new DateTime(2023,9,30),66320), - new DateTimePoint(new DateTime(2023,10,1),67081), - new DateTimePoint(new DateTime(2023,10,2),67931), - new DateTimePoint(new DateTime(2023,10,3),68727), - new DateTimePoint(new DateTime(2023,10,4),69569), - new DateTimePoint(new DateTime(2023,10,5),70347), - new DateTimePoint(new DateTime(2023,10,6),71167), - new DateTimePoint(new DateTime(2023,10,7),71915), - new DateTimePoint(new DateTime(2023,10,8),72546), - new DateTimePoint(new DateTime(2023,10,9),73330), - new DateTimePoint(new DateTime(2023,10,10),74223), - new DateTimePoint(new DateTime(2023,10,11),75207), - new DateTimePoint(new DateTime(2023,10,12),76284), - new DateTimePoint(new DateTime(2023,10,13),77348), - new DateTimePoint(new DateTime(2023,10,14),78356), - new DateTimePoint(new DateTime(2023,10,15),79852), - new DateTimePoint(new DateTime(2023,10,16),81087), - new DateTimePoint(new DateTime(2023,10,17),82108), - new DateTimePoint(new DateTime(2023,10,18),83180), - new DateTimePoint(new DateTime(2023,10,19),84145), - new DateTimePoint(new DateTime(2023,10,20),85285), - new DateTimePoint(new DateTime(2023,10,21),86398), - new DateTimePoint(new DateTime(2023,10,22),87489), - new DateTimePoint(new DateTime(2023,10,23),88763), - new DateTimePoint(new DateTime(2023,10,24),90002), - new DateTimePoint(new DateTime(2023,10,25),91309), - new DateTimePoint(new DateTime(2023,10,26),92377), - new DateTimePoint(new DateTime(2023,10,27),93477), - new DateTimePoint(new DateTime(2023,10,28),94584), - new DateTimePoint(new DateTime(2023,10,29),95584), - new DateTimePoint(new DateTime(2023,10,30),96809), - new DateTimePoint(new DateTime(2023,10,31),97990), - new DateTimePoint(new DateTime(2023,11,1),99063), - new DateTimePoint(new DateTime(2023,11,2),100199), - new DateTimePoint(new DateTime(2023,11,3),101508), - new DateTimePoint(new DateTime(2023,11,4),102808), - new DateTimePoint(new DateTime(2023,11,5),104026), - new DateTimePoint(new DateTime(2023,11,6),105451), - new DateTimePoint(new DateTime(2023,11,7),106767), - new DateTimePoint(new DateTime(2023,11,8),108124), - new DateTimePoint(new DateTime(2023,11,9),109571), - new DateTimePoint(new DateTime(2023,11,10),111004), - new DateTimePoint(new DateTime(2023,11,11),112186), + Name = "Total Reward Pools prizes [$]", + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), + Fill = null, + Stroke = new SolidColorPaint(Colors.SerieRed,4), + GeometryStroke = null, + GeometrySize = 0, + LineSmoothness = 1, + ScalesXAt = 0, + ScalesYAt = 1, // it will be scaled at the Axis[0] instance + Values = new List + { + new DateTimePoint(new DateTime(2023,6,9),0), + new DateTimePoint(new DateTime(2023,6,11),2), + new DateTimePoint(new DateTime(2023,6,12),151), + new DateTimePoint(new DateTime(2023,6,13),692), + new DateTimePoint(new DateTime(2023,6,14),1454), + new DateTimePoint(new DateTime(2023,6,15),1643), + new DateTimePoint(new DateTime(2023,6,16),2102), + new DateTimePoint(new DateTime(2023,6,17),2374), + new DateTimePoint(new DateTime(2023,6,18),2571), + new DateTimePoint(new DateTime(2023,6,19),2917), + new DateTimePoint(new DateTime(2023,6,20),3464), + new DateTimePoint(new DateTime(2023,6,21),3849), + new DateTimePoint(new DateTime(2023,6,22),4293), + new DateTimePoint(new DateTime(2023,6,23),4451), + new DateTimePoint(new DateTime(2023,6,24),4565), + new DateTimePoint(new DateTime(2023,6,25),4640), + new DateTimePoint(new DateTime(2023,6,26),4956), + new DateTimePoint(new DateTime(2023,6,27),5163), + new DateTimePoint(new DateTime(2023,6,28),5233), + new DateTimePoint(new DateTime(2023,6,29),5311), + new DateTimePoint(new DateTime(2023,6,30),5872), + new DateTimePoint(new DateTime(2023,7,1),6546), + new DateTimePoint(new DateTime(2023,7,2),6877), + new DateTimePoint(new DateTime(2023,7,3),7367), + new DateTimePoint(new DateTime(2023,7,4),7567), + new DateTimePoint(new DateTime(2023,7,5),7946), + new DateTimePoint(new DateTime(2023,7,6),8327), + new DateTimePoint(new DateTime(2023,7,7),9656), + new DateTimePoint(new DateTime(2023,7,8),10058), + new DateTimePoint(new DateTime(2023,7,9),10376), + new DateTimePoint(new DateTime(2023,7,10),10909), + new DateTimePoint(new DateTime(2023,7,11),11290), + new DateTimePoint(new DateTime(2023,7,12),11775), + new DateTimePoint(new DateTime(2023,7,13),12736), + new DateTimePoint(new DateTime(2023,7,14),14949), + new DateTimePoint(new DateTime(2023,7,15),16415), + new DateTimePoint(new DateTime(2023,7,16),18388), + new DateTimePoint(new DateTime(2023,7,17),20695), + new DateTimePoint(new DateTime(2023,7,18),22149), + new DateTimePoint(new DateTime(2023,7,19),24771), + new DateTimePoint(new DateTime(2023,7,20),26796), + new DateTimePoint(new DateTime(2023,7,21),29320), + new DateTimePoint(new DateTime(2023,7,22),31102), + new DateTimePoint(new DateTime(2023,7,23),34082), + new DateTimePoint(new DateTime(2023,7,24),38342), + new DateTimePoint(new DateTime(2023,7,25),42061), + new DateTimePoint(new DateTime(2023,7,26),46656), + new DateTimePoint(new DateTime(2023,7,27),54151), + new DateTimePoint(new DateTime(2023,7,28),67137), + new DateTimePoint(new DateTime(2023,7,29),69997), + new DateTimePoint(new DateTime(2023,7,30),73245), + new DateTimePoint(new DateTime(2023,7,31),75226), + new DateTimePoint(new DateTime(2023,8,1),77713), + new DateTimePoint(new DateTime(2023,8,2),82596), + new DateTimePoint(new DateTime(2023,8,3),85304), + new DateTimePoint(new DateTime(2023,8,4),87903), + new DateTimePoint(new DateTime(2023,8,5),89557), + new DateTimePoint(new DateTime(2023,8,6),91310), + new DateTimePoint(new DateTime(2023,8,7),94453), + new DateTimePoint(new DateTime(2023,8,8),97402), + new DateTimePoint(new DateTime(2023,8,9),100426), + new DateTimePoint(new DateTime(2023,8,10),102429), + new DateTimePoint(new DateTime(2023,8,11),105089), + new DateTimePoint(new DateTime(2023,8,12),107186), + new DateTimePoint(new DateTime(2023,8,13),109425), + new DateTimePoint(new DateTime(2023,8,14),113474), + new DateTimePoint(new DateTime(2023,8,15),115364), + new DateTimePoint(new DateTime(2023,8,16),117982), + new DateTimePoint(new DateTime(2023,8,17),120494), + new DateTimePoint(new DateTime(2023,8,18),123123), + new DateTimePoint(new DateTime(2023,8,19),124985), + new DateTimePoint(new DateTime(2023,8,20),127627), + new DateTimePoint(new DateTime(2023,8,21),129478), + new DateTimePoint(new DateTime(2023,8,22),132021), + new DateTimePoint(new DateTime(2023,8,23),134227), + new DateTimePoint(new DateTime(2023,8,24),135995), + new DateTimePoint(new DateTime(2023,8,25),138089), + new DateTimePoint(new DateTime(2023,8,26),139470), + new DateTimePoint(new DateTime(2023,8,27),140793), + new DateTimePoint(new DateTime(2023,8,28),142712), + new DateTimePoint(new DateTime(2023,8,29),144542), + new DateTimePoint(new DateTime(2023,8,30),146385), + new DateTimePoint(new DateTime(2023,8,31),148032), + new DateTimePoint(new DateTime(2023,9,1),150674), + new DateTimePoint(new DateTime(2023,9,2),152282), + new DateTimePoint(new DateTime(2023,9,3),153548), + new DateTimePoint(new DateTime(2023,9,4),155003), + new DateTimePoint(new DateTime(2023,9,5),156425), + new DateTimePoint(new DateTime(2023,9,6),158011), + new DateTimePoint(new DateTime(2023,9,7),160162), + new DateTimePoint(new DateTime(2023,9,8),161819), + new DateTimePoint(new DateTime(2023,9,9),162769), + new DateTimePoint(new DateTime(2023,9,10),163834), + new DateTimePoint(new DateTime(2023,9,11),165058), + new DateTimePoint(new DateTime(2023,9,12),166471), + new DateTimePoint(new DateTime(2023,9,13),167716), + new DateTimePoint(new DateTime(2023,9,14),170490), + new DateTimePoint(new DateTime(2023,9,15),177075), + new DateTimePoint(new DateTime(2023,9,16),180380), + new DateTimePoint(new DateTime(2023,9,17),182806), + new DateTimePoint(new DateTime(2023,9,18),185267), + new DateTimePoint(new DateTime(2023,9,19),187353), + new DateTimePoint(new DateTime(2023,9,20),189592), + new DateTimePoint(new DateTime(2023,9,21),191364), + new DateTimePoint(new DateTime(2023,9,22),193221), + new DateTimePoint(new DateTime(2023,9,23),197258), + new DateTimePoint(new DateTime(2023,9,24),200173), + new DateTimePoint(new DateTime(2023,9,25),201932), + new DateTimePoint(new DateTime(2023,9,26),203685), + new DateTimePoint(new DateTime(2023,9,27),206638), + new DateTimePoint(new DateTime(2023,9,28),209032), + new DateTimePoint(new DateTime(2023,9,29),212314), + new DateTimePoint(new DateTime(2023,9,30),214708), + new DateTimePoint(new DateTime(2023,10,1),217567), + new DateTimePoint(new DateTime(2023,10,2),220909), + new DateTimePoint(new DateTime(2023,10,3),223921), + new DateTimePoint(new DateTime(2023,10,4),234392), + new DateTimePoint(new DateTime(2023,10,5),238896), + new DateTimePoint(new DateTime(2023,10,6),244190), + new DateTimePoint(new DateTime(2023,10,7),247738), + new DateTimePoint(new DateTime(2023,10,8),251793), + new DateTimePoint(new DateTime(2023,10,9),254674), + new DateTimePoint(new DateTime(2023,10,10),257946), + new DateTimePoint(new DateTime(2023,10,11),260527), + new DateTimePoint(new DateTime(2023,10,12),266483), + new DateTimePoint(new DateTime(2023,10,13),270358), + new DateTimePoint(new DateTime(2023,10,14),273114), + new DateTimePoint(new DateTime(2023,10,15),276566), + new DateTimePoint(new DateTime(2023,10,16),279118), + new DateTimePoint(new DateTime(2023,10,17),282023), + new DateTimePoint(new DateTime(2023,10,18),286464), + new DateTimePoint(new DateTime(2023,10,19),289909), + new DateTimePoint(new DateTime(2023,10,20),294726), + new DateTimePoint(new DateTime(2023,10,21),297565), + new DateTimePoint(new DateTime(2023,10,22),300600), + new DateTimePoint(new DateTime(2023,10,23),304059), + new DateTimePoint(new DateTime(2023,10,24),308169), + new DateTimePoint(new DateTime(2023,10,25),315545), + new DateTimePoint(new DateTime(2023,10,26),318550), + new DateTimePoint(new DateTime(2023,10,27),321734), + new DateTimePoint(new DateTime(2023,10,28),324529), + new DateTimePoint(new DateTime(2023,10,29),327189), + new DateTimePoint(new DateTime(2023,10,30),329968), + new DateTimePoint(new DateTime(2023,10,31),334475), + new DateTimePoint(new DateTime(2023,11,1),337116), + new DateTimePoint(new DateTime(2023,11,2),343245), + new DateTimePoint(new DateTime(2023,11,3),347295), + new DateTimePoint(new DateTime(2023,11,4),350238), + new DateTimePoint(new DateTime(2023,11,5),353787), + new DateTimePoint(new DateTime(2023,11,6),357563), + new DateTimePoint(new DateTime(2023,11,7),360503), + new DateTimePoint(new DateTime(2023,11,8),366940), + new DateTimePoint(new DateTime(2023,11,9),371227), + new DateTimePoint(new DateTime(2023,11,10),376102), + new DateTimePoint(new DateTime(2023,11,11),380641), + } } - }, - new LineSeries + }; + } + + public override byte[] DownloadChartData() + { + var totalSerie = Series[0].As>(); + var prizeSerie = Series[1].As>(); + + var totalSerieValues = totalSerie.Values.ToList(); + var prizeSerieValues = prizeSerie.Values.ToList(); + var records = new List(); + + for (int i = 0; i < totalSerieValues.Count(); i++) { - Name = "Total Reward Pools prizes [$]", - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - Fill = null, - Stroke = new SolidColorPaint(Colors.SerieRed,4), - GeometryStroke = null, - GeometrySize = 0, - LineSmoothness = 1, - ScalesXAt = 0, - ScalesYAt = 1, // it will be scaled at the Axis[0] instance - Values = new List + records.Add(new CsvData { - new DateTimePoint(new DateTime(2023,6,9),0), - new DateTimePoint(new DateTime(2023,6,11),2), - new DateTimePoint(new DateTime(2023,6,12),151), - new DateTimePoint(new DateTime(2023,6,13),692), - new DateTimePoint(new DateTime(2023,6,14),1454), - new DateTimePoint(new DateTime(2023,6,15),1643), - new DateTimePoint(new DateTime(2023,6,16),2102), - new DateTimePoint(new DateTime(2023,6,17),2374), - new DateTimePoint(new DateTime(2023,6,18),2571), - new DateTimePoint(new DateTime(2023,6,19),2917), - new DateTimePoint(new DateTime(2023,6,20),3464), - new DateTimePoint(new DateTime(2023,6,21),3849), - new DateTimePoint(new DateTime(2023,6,22),4293), - new DateTimePoint(new DateTime(2023,6,23),4451), - new DateTimePoint(new DateTime(2023,6,24),4565), - new DateTimePoint(new DateTime(2023,6,25),4640), - new DateTimePoint(new DateTime(2023,6,26),4956), - new DateTimePoint(new DateTime(2023,6,27),5163), - new DateTimePoint(new DateTime(2023,6,28),5233), - new DateTimePoint(new DateTime(2023,6,29),5311), - new DateTimePoint(new DateTime(2023,6,30),5872), - new DateTimePoint(new DateTime(2023,7,1),6546), - new DateTimePoint(new DateTime(2023,7,2),6877), - new DateTimePoint(new DateTime(2023,7,3),7367), - new DateTimePoint(new DateTime(2023,7,4),7567), - new DateTimePoint(new DateTime(2023,7,5),7946), - new DateTimePoint(new DateTime(2023,7,6),8327), - new DateTimePoint(new DateTime(2023,7,7),9656), - new DateTimePoint(new DateTime(2023,7,8),10058), - new DateTimePoint(new DateTime(2023,7,9),10376), - new DateTimePoint(new DateTime(2023,7,10),10909), - new DateTimePoint(new DateTime(2023,7,11),11290), - new DateTimePoint(new DateTime(2023,7,12),11775), - new DateTimePoint(new DateTime(2023,7,13),12736), - new DateTimePoint(new DateTime(2023,7,14),14949), - new DateTimePoint(new DateTime(2023,7,15),16415), - new DateTimePoint(new DateTime(2023,7,16),18388), - new DateTimePoint(new DateTime(2023,7,17),20695), - new DateTimePoint(new DateTime(2023,7,18),22149), - new DateTimePoint(new DateTime(2023,7,19),24771), - new DateTimePoint(new DateTime(2023,7,20),26796), - new DateTimePoint(new DateTime(2023,7,21),29320), - new DateTimePoint(new DateTime(2023,7,22),31102), - new DateTimePoint(new DateTime(2023,7,23),34082), - new DateTimePoint(new DateTime(2023,7,24),38342), - new DateTimePoint(new DateTime(2023,7,25),42061), - new DateTimePoint(new DateTime(2023,7,26),46656), - new DateTimePoint(new DateTime(2023,7,27),54151), - new DateTimePoint(new DateTime(2023,7,28),67137), - new DateTimePoint(new DateTime(2023,7,29),69997), - new DateTimePoint(new DateTime(2023,7,30),73245), - new DateTimePoint(new DateTime(2023,7,31),75226), - new DateTimePoint(new DateTime(2023,8,1),77713), - new DateTimePoint(new DateTime(2023,8,2),82596), - new DateTimePoint(new DateTime(2023,8,3),85304), - new DateTimePoint(new DateTime(2023,8,4),87903), - new DateTimePoint(new DateTime(2023,8,5),89557), - new DateTimePoint(new DateTime(2023,8,6),91310), - new DateTimePoint(new DateTime(2023,8,7),94453), - new DateTimePoint(new DateTime(2023,8,8),97402), - new DateTimePoint(new DateTime(2023,8,9),100426), - new DateTimePoint(new DateTime(2023,8,10),102429), - new DateTimePoint(new DateTime(2023,8,11),105089), - new DateTimePoint(new DateTime(2023,8,12),107186), - new DateTimePoint(new DateTime(2023,8,13),109425), - new DateTimePoint(new DateTime(2023,8,14),113474), - new DateTimePoint(new DateTime(2023,8,15),115364), - new DateTimePoint(new DateTime(2023,8,16),117982), - new DateTimePoint(new DateTime(2023,8,17),120494), - new DateTimePoint(new DateTime(2023,8,18),123123), - new DateTimePoint(new DateTime(2023,8,19),124985), - new DateTimePoint(new DateTime(2023,8,20),127627), - new DateTimePoint(new DateTime(2023,8,21),129478), - new DateTimePoint(new DateTime(2023,8,22),132021), - new DateTimePoint(new DateTime(2023,8,23),134227), - new DateTimePoint(new DateTime(2023,8,24),135995), - new DateTimePoint(new DateTime(2023,8,25),138089), - new DateTimePoint(new DateTime(2023,8,26),139470), - new DateTimePoint(new DateTime(2023,8,27),140793), - new DateTimePoint(new DateTime(2023,8,28),142712), - new DateTimePoint(new DateTime(2023,8,29),144542), - new DateTimePoint(new DateTime(2023,8,30),146385), - new DateTimePoint(new DateTime(2023,8,31),148032), - new DateTimePoint(new DateTime(2023,9,1),150674), - new DateTimePoint(new DateTime(2023,9,2),152282), - new DateTimePoint(new DateTime(2023,9,3),153548), - new DateTimePoint(new DateTime(2023,9,4),155003), - new DateTimePoint(new DateTime(2023,9,5),156425), - new DateTimePoint(new DateTime(2023,9,6),158011), - new DateTimePoint(new DateTime(2023,9,7),160162), - new DateTimePoint(new DateTime(2023,9,8),161819), - new DateTimePoint(new DateTime(2023,9,9),162769), - new DateTimePoint(new DateTime(2023,9,10),163834), - new DateTimePoint(new DateTime(2023,9,11),165058), - new DateTimePoint(new DateTime(2023,9,12),166471), - new DateTimePoint(new DateTime(2023,9,13),167716), - new DateTimePoint(new DateTime(2023,9,14),170490), - new DateTimePoint(new DateTime(2023,9,15),177075), - new DateTimePoint(new DateTime(2023,9,16),180380), - new DateTimePoint(new DateTime(2023,9,17),182806), - new DateTimePoint(new DateTime(2023,9,18),185267), - new DateTimePoint(new DateTime(2023,9,19),187353), - new DateTimePoint(new DateTime(2023,9,20),189592), - new DateTimePoint(new DateTime(2023,9,21),191364), - new DateTimePoint(new DateTime(2023,9,22),193221), - new DateTimePoint(new DateTime(2023,9,23),197258), - new DateTimePoint(new DateTime(2023,9,24),200173), - new DateTimePoint(new DateTime(2023,9,25),201932), - new DateTimePoint(new DateTime(2023,9,26),203685), - new DateTimePoint(new DateTime(2023,9,27),206638), - new DateTimePoint(new DateTime(2023,9,28),209032), - new DateTimePoint(new DateTime(2023,9,29),212314), - new DateTimePoint(new DateTime(2023,9,30),214708), - new DateTimePoint(new DateTime(2023,10,1),217567), - new DateTimePoint(new DateTime(2023,10,2),220909), - new DateTimePoint(new DateTime(2023,10,3),223921), - new DateTimePoint(new DateTime(2023,10,4),234392), - new DateTimePoint(new DateTime(2023,10,5),238896), - new DateTimePoint(new DateTime(2023,10,6),244190), - new DateTimePoint(new DateTime(2023,10,7),247738), - new DateTimePoint(new DateTime(2023,10,8),251793), - new DateTimePoint(new DateTime(2023,10,9),254674), - new DateTimePoint(new DateTime(2023,10,10),257946), - new DateTimePoint(new DateTime(2023,10,11),260527), - new DateTimePoint(new DateTime(2023,10,12),266483), - new DateTimePoint(new DateTime(2023,10,13),270358), - new DateTimePoint(new DateTime(2023,10,14),273114), - new DateTimePoint(new DateTime(2023,10,15),276566), - new DateTimePoint(new DateTime(2023,10,16),279118), - new DateTimePoint(new DateTime(2023,10,17),282023), - new DateTimePoint(new DateTime(2023,10,18),286464), - new DateTimePoint(new DateTime(2023,10,19),289909), - new DateTimePoint(new DateTime(2023,10,20),294726), - new DateTimePoint(new DateTime(2023,10,21),297565), - new DateTimePoint(new DateTime(2023,10,22),300600), - new DateTimePoint(new DateTime(2023,10,23),304059), - new DateTimePoint(new DateTime(2023,10,24),308169), - new DateTimePoint(new DateTime(2023,10,25),315545), - new DateTimePoint(new DateTime(2023,10,26),318550), - new DateTimePoint(new DateTime(2023,10,27),321734), - new DateTimePoint(new DateTime(2023,10,28),324529), - new DateTimePoint(new DateTime(2023,10,29),327189), - new DateTimePoint(new DateTime(2023,10,30),329968), - new DateTimePoint(new DateTime(2023,10,31),334475), - new DateTimePoint(new DateTime(2023,11,1),337116), - new DateTimePoint(new DateTime(2023,11,2),343245), - new DateTimePoint(new DateTime(2023,11,3),347295), - new DateTimePoint(new DateTime(2023,11,4),350238), - new DateTimePoint(new DateTime(2023,11,5),353787), - new DateTimePoint(new DateTime(2023,11,6),357563), - new DateTimePoint(new DateTime(2023,11,7),360503), - new DateTimePoint(new DateTime(2023,11,8),366940), - new DateTimePoint(new DateTime(2023,11,9),371227), - new DateTimePoint(new DateTime(2023,11,10),376102), - new DateTimePoint(new DateTime(2023,11,11),380641), - } + Date = totalSerieValues[i].DateTime, + TotaRewardPools = totalSerieValues[i].Value, + TotalRewardPoolPrizes = prizeSerieValues[i].Value, + }); } - }; + + using (var stream = new MemoryStream()) + using (var writer = new StreamWriter(stream)) + using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) + { + csv.WriteRecords(records); + writer.Flush(); + return stream.ToArray(); + } + } + + private class CsvData + { + public DateTime Date { get; set; } + public double? TotalRewardPoolPrizes { get; set; } + public double? TotaRewardPools { get; set; } + } } } diff --git a/DeBankUI/Shared/Michal/StreamActivityDailyChart.razor.cs b/DeBankUI/Shared/Michal/StreamActivityDailyChart.razor.cs index 54889f2..ee6888b 100644 --- a/DeBankUI/Shared/Michal/StreamActivityDailyChart.razor.cs +++ b/DeBankUI/Shared/Michal/StreamActivityDailyChart.razor.cs @@ -1,468 +1,503 @@ -using DeBankUI.Components; +using CsvHelper; +using DeBankUI.Components; using DeBankUI.Utils; using LiveChartsCore; using LiveChartsCore.Defaults; using LiveChartsCore.SkiaSharpView; using LiveChartsCore.SkiaSharpView.Painting; +using MudBlazor.Extensions; using SkiaSharp; +using System.Globalization; namespace DeBankUI.Shared.Michal { public partial class StreamActivityDailyChart : BaseChartComponent { private static readonly SKColor black = SKColors.Black; - private DrawMarginFrame DrawMarginFrame => new() - { - Fill = new SolidColorPaint(Colors.ChartBackground), - Stroke = new SolidColorPaint(Colors.ChartBorder, 2) - }; - private Axis[] XAxes { get; set; } = + public StreamActivityDailyChart() { - new DateTimeAxis(TimeSpan.FromDays(1), date => date.ToString("yyyy-MM-dd")) + XAxes = new[] { - LabelsRotation = 30, - TicksPaint = new SolidColorPaint(black), - NamePaint = new SolidColorPaint(black), - LabelsPaint = new SolidColorPaint(black), - } - }; + new DateTimeAxis(TimeSpan.FromDays(1), date => date.ToString("yyyy-MM-dd")) + { + LabelsRotation = 30, + TicksPaint = new SolidColorPaint(black), + NamePaint = new SolidColorPaint(black), + LabelsPaint = new SolidColorPaint(black), + } + }; - private Axis[] YAxes { get; set; } = - { - new Axis + YAxes = new[] { - Name = "Daily number of posts", - NamePaint = new SolidColorPaint(Colors.SerieBlue), - LabelsPaint = new SolidColorPaint(Colors.SerieBlue), - TicksPaint = new SolidColorPaint(Colors.SerieBlue), - SubticksPaint = new SolidColorPaint(Colors.SerieBlue), - }, - new Axis - { - Name = "Daily number of post authors", - ShowSeparatorLines = false, - Position = LiveChartsCore.Measure.AxisPosition.End, - NamePaint = new SolidColorPaint(Colors.SerieRed), - LabelsPaint = new SolidColorPaint(Colors.SerieRed), - TicksPaint = new SolidColorPaint(Colors.SerieRed), - SubticksPaint = new SolidColorPaint(Colors.SerieRed), - }, - }; - + new Axis + { + Name = "Daily number of posts", + NamePaint = new SolidColorPaint(Colors.SerieBlue), + LabelsPaint = new SolidColorPaint(Colors.SerieBlue), + TicksPaint = new SolidColorPaint(Colors.SerieBlue), + SubticksPaint = new SolidColorPaint(Colors.SerieBlue), + }, + new Axis + { + Name = "Daily number of post authors", + ShowSeparatorLines = false, + Position = LiveChartsCore.Measure.AxisPosition.End, + NamePaint = new SolidColorPaint(Colors.SerieRed), + LabelsPaint = new SolidColorPaint(Colors.SerieRed), + TicksPaint = new SolidColorPaint(Colors.SerieRed), + SubticksPaint = new SolidColorPaint(Colors.SerieRed), + }, + }; - private ISeries[] Series { get; set; } = - { - new LineSeries + Series = new[] { - Name="Daily number of posts", - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - Stroke = new SolidColorPaint(Colors.SerieBlue,4), - GeometryStroke = null, - GeometrySize = 0, - Fill = null, - LineSmoothness = 1, - ScalesYAt = 0, // it will be scaled at the Axis[0] instance - ScalesXAt = 0, - Values = new List + new LineSeries { - new DateTimePoint(new DateTime(2023,5,6),638), - new DateTimePoint(new DateTime(2023,5,7),1125), - new DateTimePoint(new DateTime(2023,5,8),1578), - new DateTimePoint(new DateTime(2023,5,9),1199), - new DateTimePoint(new DateTime(2023,5,10),987), - new DateTimePoint(new DateTime(2023,5,11),799), - new DateTimePoint(new DateTime(2023,5,12),619), - new DateTimePoint(new DateTime(2023,5,13),551), - new DateTimePoint(new DateTime(2023,5,14),489), - new DateTimePoint(new DateTime(2023,5,15),871), - new DateTimePoint(new DateTime(2023,5,16),491), - new DateTimePoint(new DateTime(2023,5,17),676), - new DateTimePoint(new DateTime(2023,5,18),378), - new DateTimePoint(new DateTime(2023,5,19),365), - new DateTimePoint(new DateTime(2023,5,20),412), - new DateTimePoint(new DateTime(2023,5,21),409), - new DateTimePoint(new DateTime(2023,5,22),496), - new DateTimePoint(new DateTime(2023,5,23),547), - new DateTimePoint(new DateTime(2023,5,24),620), - new DateTimePoint(new DateTime(2023,5,25),1634), - new DateTimePoint(new DateTime(2023,5,26),2297), - new DateTimePoint(new DateTime(2023,5,27),1771), - new DateTimePoint(new DateTime(2023,5,28),2326), - new DateTimePoint(new DateTime(2023,5,29),2672), - new DateTimePoint(new DateTime(2023,5,30),1753), - new DateTimePoint(new DateTime(2023,5,31),1525), - new DateTimePoint(new DateTime(2023,6,1),1280), - new DateTimePoint(new DateTime(2023,6,2),1905), - new DateTimePoint(new DateTime(2023,6,3),1594), - new DateTimePoint(new DateTime(2023,6,4),1513), - new DateTimePoint(new DateTime(2023,6,5),2336), - new DateTimePoint(new DateTime(2023,6,6),1935), - new DateTimePoint(new DateTime(2023,6,7),1648), - new DateTimePoint(new DateTime(2023,6,8),1479), - new DateTimePoint(new DateTime(2023,6,9),1525), - new DateTimePoint(new DateTime(2023,6,10),1514), - new DateTimePoint(new DateTime(2023,6,11),1640), - new DateTimePoint(new DateTime(2023,6,12),1669), - new DateTimePoint(new DateTime(2023,6,13),1541), - new DateTimePoint(new DateTime(2023,6,14),1467), - new DateTimePoint(new DateTime(2023,6,15),1201), - new DateTimePoint(new DateTime(2023,6,16),6041), - new DateTimePoint(new DateTime(2023,6,17),14958), - new DateTimePoint(new DateTime(2023,6,18),13346), - new DateTimePoint(new DateTime(2023,6,19),15887), - new DateTimePoint(new DateTime(2023,6,20),3687), - new DateTimePoint(new DateTime(2023,6,21),4971), - new DateTimePoint(new DateTime(2023,6,22),2340), - new DateTimePoint(new DateTime(2023,6,23),1544), - new DateTimePoint(new DateTime(2023,6,24),2034), - new DateTimePoint(new DateTime(2023,6,25),4887), - new DateTimePoint(new DateTime(2023,6,26),2625), - new DateTimePoint(new DateTime(2023,6,27),2428), - new DateTimePoint(new DateTime(2023,6,28),2102), - new DateTimePoint(new DateTime(2023,6,29),1805), - new DateTimePoint(new DateTime(2023,6,30),1806), - new DateTimePoint(new DateTime(2023,7,1),2107), - new DateTimePoint(new DateTime(2023,7,2),2093), - new DateTimePoint(new DateTime(2023,7,3),2001), - new DateTimePoint(new DateTime(2023,7,4),1929), - new DateTimePoint(new DateTime(2023,7,5),2042), - new DateTimePoint(new DateTime(2023,7,6),2556), - new DateTimePoint(new DateTime(2023,7,7),2029), - new DateTimePoint(new DateTime(2023,7,8),1753), - new DateTimePoint(new DateTime(2023,7,9),2151), - new DateTimePoint(new DateTime(2023,7,10),3050), - new DateTimePoint(new DateTime(2023,7,11),3446), - new DateTimePoint(new DateTime(2023,7,12),3093), - new DateTimePoint(new DateTime(2023,7,13),3731), - new DateTimePoint(new DateTime(2023,7,14),4595), - new DateTimePoint(new DateTime(2023,7,15),3783), - new DateTimePoint(new DateTime(2023,7,16),3415), - new DateTimePoint(new DateTime(2023,7,17),3803), - new DateTimePoint(new DateTime(2023,7,18),4603), - new DateTimePoint(new DateTime(2023,7,19),5647), - new DateTimePoint(new DateTime(2023,7,20),6781), - new DateTimePoint(new DateTime(2023,7,21),7613), - new DateTimePoint(new DateTime(2023,7,22),8638), - new DateTimePoint(new DateTime(2023,7,23),9398), - new DateTimePoint(new DateTime(2023,7,24),13043), - new DateTimePoint(new DateTime(2023,7,25),13614), - new DateTimePoint(new DateTime(2023,7,26),14408), - new DateTimePoint(new DateTime(2023,7,27),13206), - new DateTimePoint(new DateTime(2023,7,28),12071), - new DateTimePoint(new DateTime(2023,7,29),9457), - new DateTimePoint(new DateTime(2023,7,30),7980), - new DateTimePoint(new DateTime(2023,7,31),9265), - new DateTimePoint(new DateTime(2023,8,1),9977), - new DateTimePoint(new DateTime(2023,8,2),9663), - new DateTimePoint(new DateTime(2023,8,3),9449), - new DateTimePoint(new DateTime(2023,8,4),9589), - new DateTimePoint(new DateTime(2023,8,5),8537), - new DateTimePoint(new DateTime(2023,8,6),8204), - new DateTimePoint(new DateTime(2023,8,7),7819), - new DateTimePoint(new DateTime(2023,8,8),7365), - new DateTimePoint(new DateTime(2023,8,9),7171), - new DateTimePoint(new DateTime(2023,8,10),6586), - new DateTimePoint(new DateTime(2023,8,11),8432), - new DateTimePoint(new DateTime(2023,8,12),7223), - new DateTimePoint(new DateTime(2023,8,13),6938), - new DateTimePoint(new DateTime(2023,8,14),8133), - new DateTimePoint(new DateTime(2023,8,15),7588), - new DateTimePoint(new DateTime(2023,8,16),7309), - new DateTimePoint(new DateTime(2023,8,17),7020), - new DateTimePoint(new DateTime(2023,8,18),6773), - new DateTimePoint(new DateTime(2023,8,19),7383), - new DateTimePoint(new DateTime(2023,8,20),6874), - new DateTimePoint(new DateTime(2023,8,21),7127), - new DateTimePoint(new DateTime(2023,8,22),6884), - new DateTimePoint(new DateTime(2023,8,23),6705), - new DateTimePoint(new DateTime(2023,8,24),6682), - new DateTimePoint(new DateTime(2023,8,25),5639), - new DateTimePoint(new DateTime(2023,8,26),5107), - new DateTimePoint(new DateTime(2023,8,27),5377), - new DateTimePoint(new DateTime(2023,8,28),5842), - new DateTimePoint(new DateTime(2023,8,29),6140), - new DateTimePoint(new DateTime(2023,8,30),5804), - new DateTimePoint(new DateTime(2023,8,31),5437), - new DateTimePoint(new DateTime(2023,9,1),4830), - new DateTimePoint(new DateTime(2023,9,2),4542), - new DateTimePoint(new DateTime(2023,9,3),4350), - new DateTimePoint(new DateTime(2023,9,4),4835), - new DateTimePoint(new DateTime(2023,9,5),5026), - new DateTimePoint(new DateTime(2023,9,6),4822), - new DateTimePoint(new DateTime(2023,9,7),5038), - new DateTimePoint(new DateTime(2023,9,8),4395), - new DateTimePoint(new DateTime(2023,9,9),3754), - new DateTimePoint(new DateTime(2023,9,10),3921), - new DateTimePoint(new DateTime(2023,9,11),4350), - new DateTimePoint(new DateTime(2023,9,12),4233), - new DateTimePoint(new DateTime(2023,9,13),4094), - new DateTimePoint(new DateTime(2023,9,14),4315), - new DateTimePoint(new DateTime(2023,9,15),5549), - new DateTimePoint(new DateTime(2023,9,16),4868), - new DateTimePoint(new DateTime(2023,9,17),4485), - new DateTimePoint(new DateTime(2023,9,18),5561), - new DateTimePoint(new DateTime(2023,9,19),5721), - new DateTimePoint(new DateTime(2023,9,20),5670), - new DateTimePoint(new DateTime(2023,9,21),4815), - new DateTimePoint(new DateTime(2023,9,22),4903), - new DateTimePoint(new DateTime(2023,9,23),4458), - new DateTimePoint(new DateTime(2023,9,24),4174), - new DateTimePoint(new DateTime(2023,9,25),4580), - new DateTimePoint(new DateTime(2023,9,26),4822), - new DateTimePoint(new DateTime(2023,9,27),5103), - new DateTimePoint(new DateTime(2023,9,28),4696), - new DateTimePoint(new DateTime(2023,9,29),4924), - new DateTimePoint(new DateTime(2023,9,30),4475), - new DateTimePoint(new DateTime(2023,10,1),4536), - new DateTimePoint(new DateTime(2023,10,2),5281), - new DateTimePoint(new DateTime(2023,10,3),4945), - new DateTimePoint(new DateTime(2023,10,4),4986), - new DateTimePoint(new DateTime(2023,10,5),4677), - new DateTimePoint(new DateTime(2023,10,6),5037), - new DateTimePoint(new DateTime(2023,10,7),4226), - new DateTimePoint(new DateTime(2023,10,8),3899), - new DateTimePoint(new DateTime(2023,10,9),4643), - new DateTimePoint(new DateTime(2023,10,10),5063), - new DateTimePoint(new DateTime(2023,10,11),5643), - new DateTimePoint(new DateTime(2023,10,12),5378), - new DateTimePoint(new DateTime(2023,10,13),6450), - new DateTimePoint(new DateTime(2023,10,14),6223), - new DateTimePoint(new DateTime(2023,10,15),5897), - new DateTimePoint(new DateTime(2023,10,16),7567), - new DateTimePoint(new DateTime(2023,10,17),7099), - new DateTimePoint(new DateTime(2023,10,18),7728), - new DateTimePoint(new DateTime(2023,10,19),7146), - new DateTimePoint(new DateTime(2023,10,20),7591), - new DateTimePoint(new DateTime(2023,10,21),7126), - new DateTimePoint(new DateTime(2023,10,22),7308), - new DateTimePoint(new DateTime(2023,10,23),8349), - new DateTimePoint(new DateTime(2023,10,24),7934), - new DateTimePoint(new DateTime(2023,10,25),7231), - new DateTimePoint(new DateTime(2023,10,26),6590), - new DateTimePoint(new DateTime(2023,10,27),6448), - new DateTimePoint(new DateTime(2023,10,28),6441), - new DateTimePoint(new DateTime(2023,10,29),5966), - new DateTimePoint(new DateTime(2023,10,30),7153), - new DateTimePoint(new DateTime(2023,10,31),7212), - new DateTimePoint(new DateTime(2023,11,1),7118), - new DateTimePoint(new DateTime(2023,11,2),6775), - new DateTimePoint(new DateTime(2023,11,3),7553), - new DateTimePoint(new DateTime(2023,11,4),7777), - new DateTimePoint(new DateTime(2023,11,5),7968), - new DateTimePoint(new DateTime(2023,11,6),8835), - new DateTimePoint(new DateTime(2023,11,7),8569), - new DateTimePoint(new DateTime(2023,11,8),8987), - new DateTimePoint(new DateTime(2023,11,9),9163), - new DateTimePoint(new DateTime(2023,11,10),8914), - new DateTimePoint(new DateTime(2023,11,11),7522), + Name="Daily number of posts", + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), + Stroke = new SolidColorPaint(Colors.SerieBlue,4), + GeometryStroke = null, + GeometrySize = 0, + Fill = null, + LineSmoothness = 1, + ScalesYAt = 0, // it will be scaled at the Axis[0] instance + ScalesXAt = 0, + Values = new List + { + new DateTimePoint(new DateTime(2023,5,6),638), + new DateTimePoint(new DateTime(2023,5,7),1125), + new DateTimePoint(new DateTime(2023,5,8),1578), + new DateTimePoint(new DateTime(2023,5,9),1199), + new DateTimePoint(new DateTime(2023,5,10),987), + new DateTimePoint(new DateTime(2023,5,11),799), + new DateTimePoint(new DateTime(2023,5,12),619), + new DateTimePoint(new DateTime(2023,5,13),551), + new DateTimePoint(new DateTime(2023,5,14),489), + new DateTimePoint(new DateTime(2023,5,15),871), + new DateTimePoint(new DateTime(2023,5,16),491), + new DateTimePoint(new DateTime(2023,5,17),676), + new DateTimePoint(new DateTime(2023,5,18),378), + new DateTimePoint(new DateTime(2023,5,19),365), + new DateTimePoint(new DateTime(2023,5,20),412), + new DateTimePoint(new DateTime(2023,5,21),409), + new DateTimePoint(new DateTime(2023,5,22),496), + new DateTimePoint(new DateTime(2023,5,23),547), + new DateTimePoint(new DateTime(2023,5,24),620), + new DateTimePoint(new DateTime(2023,5,25),1634), + new DateTimePoint(new DateTime(2023,5,26),2297), + new DateTimePoint(new DateTime(2023,5,27),1771), + new DateTimePoint(new DateTime(2023,5,28),2326), + new DateTimePoint(new DateTime(2023,5,29),2672), + new DateTimePoint(new DateTime(2023,5,30),1753), + new DateTimePoint(new DateTime(2023,5,31),1525), + new DateTimePoint(new DateTime(2023,6,1),1280), + new DateTimePoint(new DateTime(2023,6,2),1905), + new DateTimePoint(new DateTime(2023,6,3),1594), + new DateTimePoint(new DateTime(2023,6,4),1513), + new DateTimePoint(new DateTime(2023,6,5),2336), + new DateTimePoint(new DateTime(2023,6,6),1935), + new DateTimePoint(new DateTime(2023,6,7),1648), + new DateTimePoint(new DateTime(2023,6,8),1479), + new DateTimePoint(new DateTime(2023,6,9),1525), + new DateTimePoint(new DateTime(2023,6,10),1514), + new DateTimePoint(new DateTime(2023,6,11),1640), + new DateTimePoint(new DateTime(2023,6,12),1669), + new DateTimePoint(new DateTime(2023,6,13),1541), + new DateTimePoint(new DateTime(2023,6,14),1467), + new DateTimePoint(new DateTime(2023,6,15),1201), + new DateTimePoint(new DateTime(2023,6,16),6041), + new DateTimePoint(new DateTime(2023,6,17),14958), + new DateTimePoint(new DateTime(2023,6,18),13346), + new DateTimePoint(new DateTime(2023,6,19),15887), + new DateTimePoint(new DateTime(2023,6,20),3687), + new DateTimePoint(new DateTime(2023,6,21),4971), + new DateTimePoint(new DateTime(2023,6,22),2340), + new DateTimePoint(new DateTime(2023,6,23),1544), + new DateTimePoint(new DateTime(2023,6,24),2034), + new DateTimePoint(new DateTime(2023,6,25),4887), + new DateTimePoint(new DateTime(2023,6,26),2625), + new DateTimePoint(new DateTime(2023,6,27),2428), + new DateTimePoint(new DateTime(2023,6,28),2102), + new DateTimePoint(new DateTime(2023,6,29),1805), + new DateTimePoint(new DateTime(2023,6,30),1806), + new DateTimePoint(new DateTime(2023,7,1),2107), + new DateTimePoint(new DateTime(2023,7,2),2093), + new DateTimePoint(new DateTime(2023,7,3),2001), + new DateTimePoint(new DateTime(2023,7,4),1929), + new DateTimePoint(new DateTime(2023,7,5),2042), + new DateTimePoint(new DateTime(2023,7,6),2556), + new DateTimePoint(new DateTime(2023,7,7),2029), + new DateTimePoint(new DateTime(2023,7,8),1753), + new DateTimePoint(new DateTime(2023,7,9),2151), + new DateTimePoint(new DateTime(2023,7,10),3050), + new DateTimePoint(new DateTime(2023,7,11),3446), + new DateTimePoint(new DateTime(2023,7,12),3093), + new DateTimePoint(new DateTime(2023,7,13),3731), + new DateTimePoint(new DateTime(2023,7,14),4595), + new DateTimePoint(new DateTime(2023,7,15),3783), + new DateTimePoint(new DateTime(2023,7,16),3415), + new DateTimePoint(new DateTime(2023,7,17),3803), + new DateTimePoint(new DateTime(2023,7,18),4603), + new DateTimePoint(new DateTime(2023,7,19),5647), + new DateTimePoint(new DateTime(2023,7,20),6781), + new DateTimePoint(new DateTime(2023,7,21),7613), + new DateTimePoint(new DateTime(2023,7,22),8638), + new DateTimePoint(new DateTime(2023,7,23),9398), + new DateTimePoint(new DateTime(2023,7,24),13043), + new DateTimePoint(new DateTime(2023,7,25),13614), + new DateTimePoint(new DateTime(2023,7,26),14408), + new DateTimePoint(new DateTime(2023,7,27),13206), + new DateTimePoint(new DateTime(2023,7,28),12071), + new DateTimePoint(new DateTime(2023,7,29),9457), + new DateTimePoint(new DateTime(2023,7,30),7980), + new DateTimePoint(new DateTime(2023,7,31),9265), + new DateTimePoint(new DateTime(2023,8,1),9977), + new DateTimePoint(new DateTime(2023,8,2),9663), + new DateTimePoint(new DateTime(2023,8,3),9449), + new DateTimePoint(new DateTime(2023,8,4),9589), + new DateTimePoint(new DateTime(2023,8,5),8537), + new DateTimePoint(new DateTime(2023,8,6),8204), + new DateTimePoint(new DateTime(2023,8,7),7819), + new DateTimePoint(new DateTime(2023,8,8),7365), + new DateTimePoint(new DateTime(2023,8,9),7171), + new DateTimePoint(new DateTime(2023,8,10),6586), + new DateTimePoint(new DateTime(2023,8,11),8432), + new DateTimePoint(new DateTime(2023,8,12),7223), + new DateTimePoint(new DateTime(2023,8,13),6938), + new DateTimePoint(new DateTime(2023,8,14),8133), + new DateTimePoint(new DateTime(2023,8,15),7588), + new DateTimePoint(new DateTime(2023,8,16),7309), + new DateTimePoint(new DateTime(2023,8,17),7020), + new DateTimePoint(new DateTime(2023,8,18),6773), + new DateTimePoint(new DateTime(2023,8,19),7383), + new DateTimePoint(new DateTime(2023,8,20),6874), + new DateTimePoint(new DateTime(2023,8,21),7127), + new DateTimePoint(new DateTime(2023,8,22),6884), + new DateTimePoint(new DateTime(2023,8,23),6705), + new DateTimePoint(new DateTime(2023,8,24),6682), + new DateTimePoint(new DateTime(2023,8,25),5639), + new DateTimePoint(new DateTime(2023,8,26),5107), + new DateTimePoint(new DateTime(2023,8,27),5377), + new DateTimePoint(new DateTime(2023,8,28),5842), + new DateTimePoint(new DateTime(2023,8,29),6140), + new DateTimePoint(new DateTime(2023,8,30),5804), + new DateTimePoint(new DateTime(2023,8,31),5437), + new DateTimePoint(new DateTime(2023,9,1),4830), + new DateTimePoint(new DateTime(2023,9,2),4542), + new DateTimePoint(new DateTime(2023,9,3),4350), + new DateTimePoint(new DateTime(2023,9,4),4835), + new DateTimePoint(new DateTime(2023,9,5),5026), + new DateTimePoint(new DateTime(2023,9,6),4822), + new DateTimePoint(new DateTime(2023,9,7),5038), + new DateTimePoint(new DateTime(2023,9,8),4395), + new DateTimePoint(new DateTime(2023,9,9),3754), + new DateTimePoint(new DateTime(2023,9,10),3921), + new DateTimePoint(new DateTime(2023,9,11),4350), + new DateTimePoint(new DateTime(2023,9,12),4233), + new DateTimePoint(new DateTime(2023,9,13),4094), + new DateTimePoint(new DateTime(2023,9,14),4315), + new DateTimePoint(new DateTime(2023,9,15),5549), + new DateTimePoint(new DateTime(2023,9,16),4868), + new DateTimePoint(new DateTime(2023,9,17),4485), + new DateTimePoint(new DateTime(2023,9,18),5561), + new DateTimePoint(new DateTime(2023,9,19),5721), + new DateTimePoint(new DateTime(2023,9,20),5670), + new DateTimePoint(new DateTime(2023,9,21),4815), + new DateTimePoint(new DateTime(2023,9,22),4903), + new DateTimePoint(new DateTime(2023,9,23),4458), + new DateTimePoint(new DateTime(2023,9,24),4174), + new DateTimePoint(new DateTime(2023,9,25),4580), + new DateTimePoint(new DateTime(2023,9,26),4822), + new DateTimePoint(new DateTime(2023,9,27),5103), + new DateTimePoint(new DateTime(2023,9,28),4696), + new DateTimePoint(new DateTime(2023,9,29),4924), + new DateTimePoint(new DateTime(2023,9,30),4475), + new DateTimePoint(new DateTime(2023,10,1),4536), + new DateTimePoint(new DateTime(2023,10,2),5281), + new DateTimePoint(new DateTime(2023,10,3),4945), + new DateTimePoint(new DateTime(2023,10,4),4986), + new DateTimePoint(new DateTime(2023,10,5),4677), + new DateTimePoint(new DateTime(2023,10,6),5037), + new DateTimePoint(new DateTime(2023,10,7),4226), + new DateTimePoint(new DateTime(2023,10,8),3899), + new DateTimePoint(new DateTime(2023,10,9),4643), + new DateTimePoint(new DateTime(2023,10,10),5063), + new DateTimePoint(new DateTime(2023,10,11),5643), + new DateTimePoint(new DateTime(2023,10,12),5378), + new DateTimePoint(new DateTime(2023,10,13),6450), + new DateTimePoint(new DateTime(2023,10,14),6223), + new DateTimePoint(new DateTime(2023,10,15),5897), + new DateTimePoint(new DateTime(2023,10,16),7567), + new DateTimePoint(new DateTime(2023,10,17),7099), + new DateTimePoint(new DateTime(2023,10,18),7728), + new DateTimePoint(new DateTime(2023,10,19),7146), + new DateTimePoint(new DateTime(2023,10,20),7591), + new DateTimePoint(new DateTime(2023,10,21),7126), + new DateTimePoint(new DateTime(2023,10,22),7308), + new DateTimePoint(new DateTime(2023,10,23),8349), + new DateTimePoint(new DateTime(2023,10,24),7934), + new DateTimePoint(new DateTime(2023,10,25),7231), + new DateTimePoint(new DateTime(2023,10,26),6590), + new DateTimePoint(new DateTime(2023,10,27),6448), + new DateTimePoint(new DateTime(2023,10,28),6441), + new DateTimePoint(new DateTime(2023,10,29),5966), + new DateTimePoint(new DateTime(2023,10,30),7153), + new DateTimePoint(new DateTime(2023,10,31),7212), + new DateTimePoint(new DateTime(2023,11,1),7118), + new DateTimePoint(new DateTime(2023,11,2),6775), + new DateTimePoint(new DateTime(2023,11,3),7553), + new DateTimePoint(new DateTime(2023,11,4),7777), + new DateTimePoint(new DateTime(2023,11,5),7968), + new DateTimePoint(new DateTime(2023,11,6),8835), + new DateTimePoint(new DateTime(2023,11,7),8569), + new DateTimePoint(new DateTime(2023,11,8),8987), + new DateTimePoint(new DateTime(2023,11,9),9163), + new DateTimePoint(new DateTime(2023,11,10),8914), + new DateTimePoint(new DateTime(2023,11,11),7522), + } + }, + new LineSeries + { + Name = "Daily number of post authors", + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), + Fill = null, + Stroke = new SolidColorPaint(Colors.SerieRed,4), + GeometryStroke = null, + GeometrySize = 0, + LineSmoothness = 1, + ScalesXAt = 0, + ScalesYAt = 1, // it will be scaled at the Axis[0] instance + Values = new List + { + new DateTimePoint(new DateTime(2023,5,6),498), + new DateTimePoint(new DateTime(2023,5,7),873), + new DateTimePoint(new DateTime(2023,5,8),1219), + new DateTimePoint(new DateTime(2023,5,9),942), + new DateTimePoint(new DateTime(2023,5,10),757), + new DateTimePoint(new DateTime(2023,5,11),629), + new DateTimePoint(new DateTime(2023,5,12),496), + new DateTimePoint(new DateTime(2023,5,13),462), + new DateTimePoint(new DateTime(2023,5,14),382), + new DateTimePoint(new DateTime(2023,5,15),566), + new DateTimePoint(new DateTime(2023,5,16),391), + new DateTimePoint(new DateTime(2023,5,17),476), + new DateTimePoint(new DateTime(2023,5,18),290), + new DateTimePoint(new DateTime(2023,5,19),285), + new DateTimePoint(new DateTime(2023,5,20),306), + new DateTimePoint(new DateTime(2023,5,21),317), + new DateTimePoint(new DateTime(2023,5,22),377), + new DateTimePoint(new DateTime(2023,5,23),411), + new DateTimePoint(new DateTime(2023,5,24),439), + new DateTimePoint(new DateTime(2023,5,25),1248), + new DateTimePoint(new DateTime(2023,5,26),1510), + new DateTimePoint(new DateTime(2023,5,27),1209), + new DateTimePoint(new DateTime(2023,5,28),1557), + new DateTimePoint(new DateTime(2023,5,29),1909), + new DateTimePoint(new DateTime(2023,5,30),1236), + new DateTimePoint(new DateTime(2023,5,31),1072), + new DateTimePoint(new DateTime(2023,6,1),837), + new DateTimePoint(new DateTime(2023,6,2),1344), + new DateTimePoint(new DateTime(2023,6,3),1088), + new DateTimePoint(new DateTime(2023,6,4),1019), + new DateTimePoint(new DateTime(2023,6,5),1607), + new DateTimePoint(new DateTime(2023,6,6),1258), + new DateTimePoint(new DateTime(2023,6,7),1023), + new DateTimePoint(new DateTime(2023,6,8),923), + new DateTimePoint(new DateTime(2023,6,9),976), + new DateTimePoint(new DateTime(2023,6,10),945), + new DateTimePoint(new DateTime(2023,6,11),972), + new DateTimePoint(new DateTime(2023,6,12),932), + new DateTimePoint(new DateTime(2023,6,13),911), + new DateTimePoint(new DateTime(2023,6,14),818), + new DateTimePoint(new DateTime(2023,6,15),725), + new DateTimePoint(new DateTime(2023,6,16),5308), + new DateTimePoint(new DateTime(2023,6,17),14047), + new DateTimePoint(new DateTime(2023,6,18),12567), + new DateTimePoint(new DateTime(2023,6,19),15144), + new DateTimePoint(new DateTime(2023,6,20),2843), + new DateTimePoint(new DateTime(2023,6,21),4206), + new DateTimePoint(new DateTime(2023,6,22),1668), + new DateTimePoint(new DateTime(2023,6,23),965), + new DateTimePoint(new DateTime(2023,6,24),1558), + new DateTimePoint(new DateTime(2023,6,25),4383), + new DateTimePoint(new DateTime(2023,6,26),1632), + new DateTimePoint(new DateTime(2023,6,27),1588), + new DateTimePoint(new DateTime(2023,6,28),1437), + new DateTimePoint(new DateTime(2023,6,29),1156), + new DateTimePoint(new DateTime(2023,6,30),1051), + new DateTimePoint(new DateTime(2023,7,1),1264), + new DateTimePoint(new DateTime(2023,7,2),1323), + new DateTimePoint(new DateTime(2023,7,3),1221), + new DateTimePoint(new DateTime(2023,7,4),1163), + new DateTimePoint(new DateTime(2023,7,5),1244), + new DateTimePoint(new DateTime(2023,7,6),1528), + new DateTimePoint(new DateTime(2023,7,7),1309), + new DateTimePoint(new DateTime(2023,7,8),1150), + new DateTimePoint(new DateTime(2023,7,9),1462), + new DateTimePoint(new DateTime(2023,7,10),1949), + new DateTimePoint(new DateTime(2023,7,11),2172), + new DateTimePoint(new DateTime(2023,7,12),1933), + new DateTimePoint(new DateTime(2023,7,13),2216), + new DateTimePoint(new DateTime(2023,7,14),2564), + new DateTimePoint(new DateTime(2023,7,15),2120), + new DateTimePoint(new DateTime(2023,7,16),1863), + new DateTimePoint(new DateTime(2023,7,17),2035), + new DateTimePoint(new DateTime(2023,7,18),2454), + new DateTimePoint(new DateTime(2023,7,19),3228), + new DateTimePoint(new DateTime(2023,7,20),3751), + new DateTimePoint(new DateTime(2023,7,21),3874), + new DateTimePoint(new DateTime(2023,7,22),5035), + new DateTimePoint(new DateTime(2023,7,23),5369), + new DateTimePoint(new DateTime(2023,7,24),7334), + new DateTimePoint(new DateTime(2023,7,25),7721), + new DateTimePoint(new DateTime(2023,7,26),8710), + new DateTimePoint(new DateTime(2023,7,27),7174), + new DateTimePoint(new DateTime(2023,7,28),6735), + new DateTimePoint(new DateTime(2023,7,29),5299), + new DateTimePoint(new DateTime(2023,7,30),4815), + new DateTimePoint(new DateTime(2023,7,31),5217), + new DateTimePoint(new DateTime(2023,8,1),5907), + new DateTimePoint(new DateTime(2023,8,2),5393), + new DateTimePoint(new DateTime(2023,8,3),5309), + new DateTimePoint(new DateTime(2023,8,4),5488), + new DateTimePoint(new DateTime(2023,8,5),4992), + new DateTimePoint(new DateTime(2023,8,6),4846), + new DateTimePoint(new DateTime(2023,8,7),4673), + new DateTimePoint(new DateTime(2023,8,8),4244), + new DateTimePoint(new DateTime(2023,8,9),4090), + new DateTimePoint(new DateTime(2023,8,10),3704), + new DateTimePoint(new DateTime(2023,8,11),5231), + new DateTimePoint(new DateTime(2023,8,12),4638), + new DateTimePoint(new DateTime(2023,8,13),4431), + new DateTimePoint(new DateTime(2023,8,14),4977), + new DateTimePoint(new DateTime(2023,8,15),4644), + new DateTimePoint(new DateTime(2023,8,16),4463), + new DateTimePoint(new DateTime(2023,8,17),4209), + new DateTimePoint(new DateTime(2023,8,18),4216), + new DateTimePoint(new DateTime(2023,8,19),4664), + new DateTimePoint(new DateTime(2023,8,20),4347), + new DateTimePoint(new DateTime(2023,8,21),4341), + new DateTimePoint(new DateTime(2023,8,22),4247), + new DateTimePoint(new DateTime(2023,8,23),4077), + new DateTimePoint(new DateTime(2023,8,24),4088), + new DateTimePoint(new DateTime(2023,8,25),3533), + new DateTimePoint(new DateTime(2023,8,26),3308), + new DateTimePoint(new DateTime(2023,8,27),3408), + new DateTimePoint(new DateTime(2023,8,28),3818), + new DateTimePoint(new DateTime(2023,8,29),3794), + new DateTimePoint(new DateTime(2023,8,30),3746), + new DateTimePoint(new DateTime(2023,8,31),3542), + new DateTimePoint(new DateTime(2023,9,1),3096), + new DateTimePoint(new DateTime(2023,9,2),2945), + new DateTimePoint(new DateTime(2023,9,3),2667), + new DateTimePoint(new DateTime(2023,9,4),2998), + new DateTimePoint(new DateTime(2023,9,5),2998), + new DateTimePoint(new DateTime(2023,9,6),2909), + new DateTimePoint(new DateTime(2023,9,7),3015), + new DateTimePoint(new DateTime(2023,9,8),2627), + new DateTimePoint(new DateTime(2023,9,9),2360), + new DateTimePoint(new DateTime(2023,9,10),2455), + new DateTimePoint(new DateTime(2023,9,11),2677), + new DateTimePoint(new DateTime(2023,9,12),2547), + new DateTimePoint(new DateTime(2023,9,13),2533), + new DateTimePoint(new DateTime(2023,9,14),2755), + new DateTimePoint(new DateTime(2023,9,15),3284), + new DateTimePoint(new DateTime(2023,9,16),2969), + new DateTimePoint(new DateTime(2023,9,17),2727), + new DateTimePoint(new DateTime(2023,9,18),3319), + new DateTimePoint(new DateTime(2023,9,19),3282), + new DateTimePoint(new DateTime(2023,9,20),3157), + new DateTimePoint(new DateTime(2023,9,21),2789), + new DateTimePoint(new DateTime(2023,9,22),2807), + new DateTimePoint(new DateTime(2023,9,23),2611), + new DateTimePoint(new DateTime(2023,9,24),2492), + new DateTimePoint(new DateTime(2023,9,25),2651), + new DateTimePoint(new DateTime(2023,9,26),2817), + new DateTimePoint(new DateTime(2023,9,27),2950), + new DateTimePoint(new DateTime(2023,9,28),2632), + new DateTimePoint(new DateTime(2023,9,29),2774), + new DateTimePoint(new DateTime(2023,9,30),2649), + new DateTimePoint(new DateTime(2023,10,1),2635), + new DateTimePoint(new DateTime(2023,10,2),2938), + new DateTimePoint(new DateTime(2023,10,3),2782), + new DateTimePoint(new DateTime(2023,10,4),2705), + new DateTimePoint(new DateTime(2023,10,5),2663), + new DateTimePoint(new DateTime(2023,10,6),2810), + new DateTimePoint(new DateTime(2023,10,7),2378), + new DateTimePoint(new DateTime(2023,10,8),2281), + new DateTimePoint(new DateTime(2023,10,9),2578), + new DateTimePoint(new DateTime(2023,10,10),2878), + new DateTimePoint(new DateTime(2023,10,11),3060), + new DateTimePoint(new DateTime(2023,10,12),2929), + new DateTimePoint(new DateTime(2023,10,13),3527), + new DateTimePoint(new DateTime(2023,10,14),3328), + new DateTimePoint(new DateTime(2023,10,15),3232), + new DateTimePoint(new DateTime(2023,10,16),3842), + new DateTimePoint(new DateTime(2023,10,17),3657), + new DateTimePoint(new DateTime(2023,10,18),3653), + new DateTimePoint(new DateTime(2023,10,19),3482), + new DateTimePoint(new DateTime(2023,10,20),3714), + new DateTimePoint(new DateTime(2023,10,21),3657), + new DateTimePoint(new DateTime(2023,10,22),3877), + new DateTimePoint(new DateTime(2023,10,23),4089), + new DateTimePoint(new DateTime(2023,10,24),4032), + new DateTimePoint(new DateTime(2023,10,25),3588), + new DateTimePoint(new DateTime(2023,10,26),3365), + new DateTimePoint(new DateTime(2023,10,27),3249), + new DateTimePoint(new DateTime(2023,10,28),3317), + new DateTimePoint(new DateTime(2023,10,29),3049), + new DateTimePoint(new DateTime(2023,10,30),3435), + new DateTimePoint(new DateTime(2023,10,31),3437), + new DateTimePoint(new DateTime(2023,11,1),3469), + new DateTimePoint(new DateTime(2023,11,2),3296), + new DateTimePoint(new DateTime(2023,11,3),3528), + new DateTimePoint(new DateTime(2023,11,4),3764), + new DateTimePoint(new DateTime(2023,11,5),3850), + new DateTimePoint(new DateTime(2023,11,6),4168), + new DateTimePoint(new DateTime(2023,11,7),3974), + new DateTimePoint(new DateTime(2023,11,8),4017), + new DateTimePoint(new DateTime(2023,11,9),4113), + new DateTimePoint(new DateTime(2023,11,10),4087), + new DateTimePoint(new DateTime(2023,11,11),3500), + } } - }, - new LineSeries + }; + } + public override byte[] DownloadChartData() + { + var dailyPostsSerie = Series[0].As>(); + var dailyAuthorsSerie = Series[1].As>(); + + var dailyPostsSerieValues = dailyPostsSerie.Values.ToList(); + var dailyAuthorsSerieValues = dailyAuthorsSerie.Values.ToList(); + var records = new List(); + + for (int i = 0; i < dailyPostsSerieValues.Count(); i++) { - Name = "Daily number of post authors", - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - Fill = null, - Stroke = new SolidColorPaint(Colors.SerieRed,4), - GeometryStroke = null, - GeometrySize = 0, - LineSmoothness = 1, - ScalesXAt = 0, - ScalesYAt = 1, // it will be scaled at the Axis[0] instance - Values = new List + records.Add(new CsvData { - new DateTimePoint(new DateTime(2023,5,6),498), - new DateTimePoint(new DateTime(2023,5,7),873), - new DateTimePoint(new DateTime(2023,5,8),1219), - new DateTimePoint(new DateTime(2023,5,9),942), - new DateTimePoint(new DateTime(2023,5,10),757), - new DateTimePoint(new DateTime(2023,5,11),629), - new DateTimePoint(new DateTime(2023,5,12),496), - new DateTimePoint(new DateTime(2023,5,13),462), - new DateTimePoint(new DateTime(2023,5,14),382), - new DateTimePoint(new DateTime(2023,5,15),566), - new DateTimePoint(new DateTime(2023,5,16),391), - new DateTimePoint(new DateTime(2023,5,17),476), - new DateTimePoint(new DateTime(2023,5,18),290), - new DateTimePoint(new DateTime(2023,5,19),285), - new DateTimePoint(new DateTime(2023,5,20),306), - new DateTimePoint(new DateTime(2023,5,21),317), - new DateTimePoint(new DateTime(2023,5,22),377), - new DateTimePoint(new DateTime(2023,5,23),411), - new DateTimePoint(new DateTime(2023,5,24),439), - new DateTimePoint(new DateTime(2023,5,25),1248), - new DateTimePoint(new DateTime(2023,5,26),1510), - new DateTimePoint(new DateTime(2023,5,27),1209), - new DateTimePoint(new DateTime(2023,5,28),1557), - new DateTimePoint(new DateTime(2023,5,29),1909), - new DateTimePoint(new DateTime(2023,5,30),1236), - new DateTimePoint(new DateTime(2023,5,31),1072), - new DateTimePoint(new DateTime(2023,6,1),837), - new DateTimePoint(new DateTime(2023,6,2),1344), - new DateTimePoint(new DateTime(2023,6,3),1088), - new DateTimePoint(new DateTime(2023,6,4),1019), - new DateTimePoint(new DateTime(2023,6,5),1607), - new DateTimePoint(new DateTime(2023,6,6),1258), - new DateTimePoint(new DateTime(2023,6,7),1023), - new DateTimePoint(new DateTime(2023,6,8),923), - new DateTimePoint(new DateTime(2023,6,9),976), - new DateTimePoint(new DateTime(2023,6,10),945), - new DateTimePoint(new DateTime(2023,6,11),972), - new DateTimePoint(new DateTime(2023,6,12),932), - new DateTimePoint(new DateTime(2023,6,13),911), - new DateTimePoint(new DateTime(2023,6,14),818), - new DateTimePoint(new DateTime(2023,6,15),725), - new DateTimePoint(new DateTime(2023,6,16),5308), - new DateTimePoint(new DateTime(2023,6,17),14047), - new DateTimePoint(new DateTime(2023,6,18),12567), - new DateTimePoint(new DateTime(2023,6,19),15144), - new DateTimePoint(new DateTime(2023,6,20),2843), - new DateTimePoint(new DateTime(2023,6,21),4206), - new DateTimePoint(new DateTime(2023,6,22),1668), - new DateTimePoint(new DateTime(2023,6,23),965), - new DateTimePoint(new DateTime(2023,6,24),1558), - new DateTimePoint(new DateTime(2023,6,25),4383), - new DateTimePoint(new DateTime(2023,6,26),1632), - new DateTimePoint(new DateTime(2023,6,27),1588), - new DateTimePoint(new DateTime(2023,6,28),1437), - new DateTimePoint(new DateTime(2023,6,29),1156), - new DateTimePoint(new DateTime(2023,6,30),1051), - new DateTimePoint(new DateTime(2023,7,1),1264), - new DateTimePoint(new DateTime(2023,7,2),1323), - new DateTimePoint(new DateTime(2023,7,3),1221), - new DateTimePoint(new DateTime(2023,7,4),1163), - new DateTimePoint(new DateTime(2023,7,5),1244), - new DateTimePoint(new DateTime(2023,7,6),1528), - new DateTimePoint(new DateTime(2023,7,7),1309), - new DateTimePoint(new DateTime(2023,7,8),1150), - new DateTimePoint(new DateTime(2023,7,9),1462), - new DateTimePoint(new DateTime(2023,7,10),1949), - new DateTimePoint(new DateTime(2023,7,11),2172), - new DateTimePoint(new DateTime(2023,7,12),1933), - new DateTimePoint(new DateTime(2023,7,13),2216), - new DateTimePoint(new DateTime(2023,7,14),2564), - new DateTimePoint(new DateTime(2023,7,15),2120), - new DateTimePoint(new DateTime(2023,7,16),1863), - new DateTimePoint(new DateTime(2023,7,17),2035), - new DateTimePoint(new DateTime(2023,7,18),2454), - new DateTimePoint(new DateTime(2023,7,19),3228), - new DateTimePoint(new DateTime(2023,7,20),3751), - new DateTimePoint(new DateTime(2023,7,21),3874), - new DateTimePoint(new DateTime(2023,7,22),5035), - new DateTimePoint(new DateTime(2023,7,23),5369), - new DateTimePoint(new DateTime(2023,7,24),7334), - new DateTimePoint(new DateTime(2023,7,25),7721), - new DateTimePoint(new DateTime(2023,7,26),8710), - new DateTimePoint(new DateTime(2023,7,27),7174), - new DateTimePoint(new DateTime(2023,7,28),6735), - new DateTimePoint(new DateTime(2023,7,29),5299), - new DateTimePoint(new DateTime(2023,7,30),4815), - new DateTimePoint(new DateTime(2023,7,31),5217), - new DateTimePoint(new DateTime(2023,8,1),5907), - new DateTimePoint(new DateTime(2023,8,2),5393), - new DateTimePoint(new DateTime(2023,8,3),5309), - new DateTimePoint(new DateTime(2023,8,4),5488), - new DateTimePoint(new DateTime(2023,8,5),4992), - new DateTimePoint(new DateTime(2023,8,6),4846), - new DateTimePoint(new DateTime(2023,8,7),4673), - new DateTimePoint(new DateTime(2023,8,8),4244), - new DateTimePoint(new DateTime(2023,8,9),4090), - new DateTimePoint(new DateTime(2023,8,10),3704), - new DateTimePoint(new DateTime(2023,8,11),5231), - new DateTimePoint(new DateTime(2023,8,12),4638), - new DateTimePoint(new DateTime(2023,8,13),4431), - new DateTimePoint(new DateTime(2023,8,14),4977), - new DateTimePoint(new DateTime(2023,8,15),4644), - new DateTimePoint(new DateTime(2023,8,16),4463), - new DateTimePoint(new DateTime(2023,8,17),4209), - new DateTimePoint(new DateTime(2023,8,18),4216), - new DateTimePoint(new DateTime(2023,8,19),4664), - new DateTimePoint(new DateTime(2023,8,20),4347), - new DateTimePoint(new DateTime(2023,8,21),4341), - new DateTimePoint(new DateTime(2023,8,22),4247), - new DateTimePoint(new DateTime(2023,8,23),4077), - new DateTimePoint(new DateTime(2023,8,24),4088), - new DateTimePoint(new DateTime(2023,8,25),3533), - new DateTimePoint(new DateTime(2023,8,26),3308), - new DateTimePoint(new DateTime(2023,8,27),3408), - new DateTimePoint(new DateTime(2023,8,28),3818), - new DateTimePoint(new DateTime(2023,8,29),3794), - new DateTimePoint(new DateTime(2023,8,30),3746), - new DateTimePoint(new DateTime(2023,8,31),3542), - new DateTimePoint(new DateTime(2023,9,1),3096), - new DateTimePoint(new DateTime(2023,9,2),2945), - new DateTimePoint(new DateTime(2023,9,3),2667), - new DateTimePoint(new DateTime(2023,9,4),2998), - new DateTimePoint(new DateTime(2023,9,5),2998), - new DateTimePoint(new DateTime(2023,9,6),2909), - new DateTimePoint(new DateTime(2023,9,7),3015), - new DateTimePoint(new DateTime(2023,9,8),2627), - new DateTimePoint(new DateTime(2023,9,9),2360), - new DateTimePoint(new DateTime(2023,9,10),2455), - new DateTimePoint(new DateTime(2023,9,11),2677), - new DateTimePoint(new DateTime(2023,9,12),2547), - new DateTimePoint(new DateTime(2023,9,13),2533), - new DateTimePoint(new DateTime(2023,9,14),2755), - new DateTimePoint(new DateTime(2023,9,15),3284), - new DateTimePoint(new DateTime(2023,9,16),2969), - new DateTimePoint(new DateTime(2023,9,17),2727), - new DateTimePoint(new DateTime(2023,9,18),3319), - new DateTimePoint(new DateTime(2023,9,19),3282), - new DateTimePoint(new DateTime(2023,9,20),3157), - new DateTimePoint(new DateTime(2023,9,21),2789), - new DateTimePoint(new DateTime(2023,9,22),2807), - new DateTimePoint(new DateTime(2023,9,23),2611), - new DateTimePoint(new DateTime(2023,9,24),2492), - new DateTimePoint(new DateTime(2023,9,25),2651), - new DateTimePoint(new DateTime(2023,9,26),2817), - new DateTimePoint(new DateTime(2023,9,27),2950), - new DateTimePoint(new DateTime(2023,9,28),2632), - new DateTimePoint(new DateTime(2023,9,29),2774), - new DateTimePoint(new DateTime(2023,9,30),2649), - new DateTimePoint(new DateTime(2023,10,1),2635), - new DateTimePoint(new DateTime(2023,10,2),2938), - new DateTimePoint(new DateTime(2023,10,3),2782), - new DateTimePoint(new DateTime(2023,10,4),2705), - new DateTimePoint(new DateTime(2023,10,5),2663), - new DateTimePoint(new DateTime(2023,10,6),2810), - new DateTimePoint(new DateTime(2023,10,7),2378), - new DateTimePoint(new DateTime(2023,10,8),2281), - new DateTimePoint(new DateTime(2023,10,9),2578), - new DateTimePoint(new DateTime(2023,10,10),2878), - new DateTimePoint(new DateTime(2023,10,11),3060), - new DateTimePoint(new DateTime(2023,10,12),2929), - new DateTimePoint(new DateTime(2023,10,13),3527), - new DateTimePoint(new DateTime(2023,10,14),3328), - new DateTimePoint(new DateTime(2023,10,15),3232), - new DateTimePoint(new DateTime(2023,10,16),3842), - new DateTimePoint(new DateTime(2023,10,17),3657), - new DateTimePoint(new DateTime(2023,10,18),3653), - new DateTimePoint(new DateTime(2023,10,19),3482), - new DateTimePoint(new DateTime(2023,10,20),3714), - new DateTimePoint(new DateTime(2023,10,21),3657), - new DateTimePoint(new DateTime(2023,10,22),3877), - new DateTimePoint(new DateTime(2023,10,23),4089), - new DateTimePoint(new DateTime(2023,10,24),4032), - new DateTimePoint(new DateTime(2023,10,25),3588), - new DateTimePoint(new DateTime(2023,10,26),3365), - new DateTimePoint(new DateTime(2023,10,27),3249), - new DateTimePoint(new DateTime(2023,10,28),3317), - new DateTimePoint(new DateTime(2023,10,29),3049), - new DateTimePoint(new DateTime(2023,10,30),3435), - new DateTimePoint(new DateTime(2023,10,31),3437), - new DateTimePoint(new DateTime(2023,11,1),3469), - new DateTimePoint(new DateTime(2023,11,2),3296), - new DateTimePoint(new DateTime(2023,11,3),3528), - new DateTimePoint(new DateTime(2023,11,4),3764), - new DateTimePoint(new DateTime(2023,11,5),3850), - new DateTimePoint(new DateTime(2023,11,6),4168), - new DateTimePoint(new DateTime(2023,11,7),3974), - new DateTimePoint(new DateTime(2023,11,8),4017), - new DateTimePoint(new DateTime(2023,11,9),4113), - new DateTimePoint(new DateTime(2023,11,10),4087), - new DateTimePoint(new DateTime(2023,11,11),3500), - } + Date = dailyPostsSerieValues[i].DateTime, + DailyPosts = dailyPostsSerieValues[i].Value, + DailyAuthors = dailyAuthorsSerieValues[i].Value, + }); } - }; + + using (var stream = new MemoryStream()) + using (var writer = new StreamWriter(stream)) + using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) + { + csv.WriteRecords(records); + writer.Flush(); + return stream.ToArray(); + } + } + + private class CsvData + { + public DateTime Date { get; set; } + public double? DailyPosts { get; set; } + public double? DailyAuthors { get; set; } + } } } diff --git a/DeBankUI/Shared/Michal/StreamActivityHistogram.razor.cs b/DeBankUI/Shared/Michal/StreamActivityHistogram.razor.cs index fcf9ef0..8d44555 100644 --- a/DeBankUI/Shared/Michal/StreamActivityHistogram.razor.cs +++ b/DeBankUI/Shared/Michal/StreamActivityHistogram.razor.cs @@ -1,51 +1,84 @@ -using DeBankUI.Components; +using CsvHelper; +using DeBankUI.Components; using DeBankUI.Utils; using LiveChartsCore; using LiveChartsCore.Defaults; using LiveChartsCore.SkiaSharpView; using LiveChartsCore.SkiaSharpView.Painting; +using MudBlazor.Extensions; using SkiaSharp; +using System.Globalization; namespace DeBankUI.Shared.Michal { public partial class StreamActivityHistogram : BaseChartComponent { private static readonly SKColor black = SKColors.Black; - private DrawMarginFrame DrawMarginFrame => new() - { - Fill = new SolidColorPaint(Colors.ChartBackground), - Stroke = new SolidColorPaint(Colors.ChartBorder, 2) - }; - public ISeries[] Series { get; set; } = + public StreamActivityHistogram() { - new ColumnSeries + Series = new[] + { + new ColumnSeries + { + Name = "Number of authors", + Values = new int[] { 100029, 26428, 15535, 7102 }, + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), + }, + }; + + YAxes = new[] + { + new Axis + { + Name = "Number of authors", + MinLimit = 0, + } + }; + + XAxes = new[] { - Name = "Number of authors", - Values = new double[] { 100029, 26428, 15535, 7102 }, - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - }, - }; + new Axis + { + Name = "Total number of posts by the author", + Labels = new string[] { "1", "2-5", "5-25", ">25" }, + LabelsRotation = 0, + SeparatorsAtCenter = false, + ForceStepToMin = true, + } + }; + } - public Axis[] YAxes { get; set; } = + public override byte[] DownloadChartData() { - new Axis + var columnSerie = Series[0].As>(); + var columnSerieValues = columnSerie.Values.ToList(); + var columnSerieCategories = XAxes[0].Labels.ToList(); + var records = new List(); + + for (int i = 0; i < columnSerie.Values.Count(); i++) { - Name = "Number of authors", - MinLimit = 0, + records.Add(new CsvData + { + NumberOfAuthors = columnSerieValues[i], + NumberOfPostsByAuthor = columnSerieCategories[i], + }); } - }; - public Axis[] XAxes { get; set; } = - { - new Axis + using (var stream = new MemoryStream()) + using (var writer = new StreamWriter(stream)) + using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) { - Name = "Total number of posts by the author", - Labels = new string[] { "1", "2-5", "5-25", ">25" }, - LabelsRotation = 0, - SeparatorsAtCenter = false, - ForceStepToMin = true, + csv.WriteRecords(records); + writer.Flush(); + return stream.ToArray(); } - }; + } + + private class CsvData + { + public string? NumberOfPostsByAuthor { get; set; } + public int? NumberOfAuthors { get; set; } + } } } \ No newline at end of file diff --git a/DeBankUI/Shared/Michal/StreamActivityTotalChart.razor.cs b/DeBankUI/Shared/Michal/StreamActivityTotalChart.razor.cs index 156505f..c9c8b2e 100644 --- a/DeBankUI/Shared/Michal/StreamActivityTotalChart.razor.cs +++ b/DeBankUI/Shared/Michal/StreamActivityTotalChart.razor.cs @@ -1,468 +1,503 @@ -using DeBankUI.Components; +using CsvHelper; +using DeBankUI.Components; using DeBankUI.Utils; using LiveChartsCore; using LiveChartsCore.Defaults; using LiveChartsCore.SkiaSharpView; using LiveChartsCore.SkiaSharpView.Painting; +using MudBlazor.Extensions; using SkiaSharp; +using System.Globalization; namespace DeBankUI.Shared.Michal { public partial class StreamActivityTotalChart : BaseChartComponent { private static readonly SKColor black = SKColors.Black; - private DrawMarginFrame DrawMarginFrame => new() - { - Fill = new SolidColorPaint(Colors.ChartBackground), - Stroke = new SolidColorPaint(Colors.ChartBorder, 2) - }; - private Axis[] XAxes { get; set; } = + public StreamActivityTotalChart() { - new DateTimeAxis(TimeSpan.FromDays(1), date => date.ToString("yyyy-MM-dd")) + XAxes = new[] { - LabelsRotation = 30, - TicksPaint = new SolidColorPaint(black), - NamePaint = new SolidColorPaint(black), - LabelsPaint = new SolidColorPaint(black), - } - }; + new DateTimeAxis(TimeSpan.FromDays(1), date => date.ToString("yyyy-MM-dd")) + { + LabelsRotation = 30, + TicksPaint = new SolidColorPaint(black), + NamePaint = new SolidColorPaint(black), + LabelsPaint = new SolidColorPaint(black), + } + }; - private Axis[] YAxes { get; set; } = - { - new Axis + YAxes = new[] { - Name = "Total number of posts", - NamePaint = new SolidColorPaint(Colors.SerieBlue), - LabelsPaint = new SolidColorPaint(Colors.SerieBlue), - TicksPaint = new SolidColorPaint(Colors.SerieBlue), - SubticksPaint = new SolidColorPaint(Colors.SerieBlue), - }, - new Axis - { - Name = "Total number of post authors", - ShowSeparatorLines = false, - Position = LiveChartsCore.Measure.AxisPosition.End, - NamePaint = new SolidColorPaint(Colors.SerieRed), - LabelsPaint = new SolidColorPaint(Colors.SerieRed), - TicksPaint = new SolidColorPaint(Colors.SerieRed), - SubticksPaint = new SolidColorPaint(Colors.SerieRed), - }, - }; - + new Axis + { + Name = "Total number of posts", + NamePaint = new SolidColorPaint(Colors.SerieBlue), + LabelsPaint = new SolidColorPaint(Colors.SerieBlue), + TicksPaint = new SolidColorPaint(Colors.SerieBlue), + SubticksPaint = new SolidColorPaint(Colors.SerieBlue), + }, + new Axis + { + Name = "Total number of post authors", + ShowSeparatorLines = false, + Position = LiveChartsCore.Measure.AxisPosition.End, + NamePaint = new SolidColorPaint(Colors.SerieRed), + LabelsPaint = new SolidColorPaint(Colors.SerieRed), + TicksPaint = new SolidColorPaint(Colors.SerieRed), + SubticksPaint = new SolidColorPaint(Colors.SerieRed), + }, + }; - private ISeries[] Series { get; set; } = - { - new LineSeries + Series = new[] { - Name="Total number of posts", - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - Stroke = new SolidColorPaint(Colors.SerieBlue,4), - GeometryStroke = null, - GeometrySize = 0, - Fill = null, - LineSmoothness = 1, - ScalesYAt = 0, // it will be scaled at the Axis[0] instance - ScalesXAt = 0, - Values = new List + new LineSeries { - new DateTimePoint(new DateTime(2023,5,6),638), - new DateTimePoint(new DateTime(2023,5,7),1763), - new DateTimePoint(new DateTime(2023,5,8),3341), - new DateTimePoint(new DateTime(2023,5,9),4540), - new DateTimePoint(new DateTime(2023,5,10),5527), - new DateTimePoint(new DateTime(2023,5,11),6326), - new DateTimePoint(new DateTime(2023,5,12),6945), - new DateTimePoint(new DateTime(2023,5,13),7496), - new DateTimePoint(new DateTime(2023,5,14),7985), - new DateTimePoint(new DateTime(2023,5,15),8856), - new DateTimePoint(new DateTime(2023,5,16),9347), - new DateTimePoint(new DateTime(2023,5,17),10023), - new DateTimePoint(new DateTime(2023,5,18),10401), - new DateTimePoint(new DateTime(2023,5,19),10766), - new DateTimePoint(new DateTime(2023,5,20),11178), - new DateTimePoint(new DateTime(2023,5,21),11587), - new DateTimePoint(new DateTime(2023,5,22),12083), - new DateTimePoint(new DateTime(2023,5,23),12630), - new DateTimePoint(new DateTime(2023,5,24),13250), - new DateTimePoint(new DateTime(2023,5,25),14884), - new DateTimePoint(new DateTime(2023,5,26),17181), - new DateTimePoint(new DateTime(2023,5,27),18952), - new DateTimePoint(new DateTime(2023,5,28),21278), - new DateTimePoint(new DateTime(2023,5,29),23950), - new DateTimePoint(new DateTime(2023,5,30),25703), - new DateTimePoint(new DateTime(2023,5,31),27228), - new DateTimePoint(new DateTime(2023,6,1),28508), - new DateTimePoint(new DateTime(2023,6,2),30413), - new DateTimePoint(new DateTime(2023,6,3),32007), - new DateTimePoint(new DateTime(2023,6,4),33520), - new DateTimePoint(new DateTime(2023,6,5),35856), - new DateTimePoint(new DateTime(2023,6,6),37791), - new DateTimePoint(new DateTime(2023,6,7),39439), - new DateTimePoint(new DateTime(2023,6,8),40918), - new DateTimePoint(new DateTime(2023,6,9),42443), - new DateTimePoint(new DateTime(2023,6,10),43957), - new DateTimePoint(new DateTime(2023,6,11),45597), - new DateTimePoint(new DateTime(2023,6,12),47266), - new DateTimePoint(new DateTime(2023,6,13),48807), - new DateTimePoint(new DateTime(2023,6,14),50274), - new DateTimePoint(new DateTime(2023,6,15),51475), - new DateTimePoint(new DateTime(2023,6,16),57516), - new DateTimePoint(new DateTime(2023,6,17),72474), - new DateTimePoint(new DateTime(2023,6,18),85820), - new DateTimePoint(new DateTime(2023,6,19),101707), - new DateTimePoint(new DateTime(2023,6,20),105394), - new DateTimePoint(new DateTime(2023,6,21),110365), - new DateTimePoint(new DateTime(2023,6,22),112705), - new DateTimePoint(new DateTime(2023,6,23),114249), - new DateTimePoint(new DateTime(2023,6,24),116283), - new DateTimePoint(new DateTime(2023,6,25),121170), - new DateTimePoint(new DateTime(2023,6,26),123795), - new DateTimePoint(new DateTime(2023,6,27),126223), - new DateTimePoint(new DateTime(2023,6,28),128325), - new DateTimePoint(new DateTime(2023,6,29),130130), - new DateTimePoint(new DateTime(2023,6,30),131936), - new DateTimePoint(new DateTime(2023,7,1),134043), - new DateTimePoint(new DateTime(2023,7,2),136136), - new DateTimePoint(new DateTime(2023,7,3),138137), - new DateTimePoint(new DateTime(2023,7,4),140066), - new DateTimePoint(new DateTime(2023,7,5),142108), - new DateTimePoint(new DateTime(2023,7,6),144664), - new DateTimePoint(new DateTime(2023,7,7),146693), - new DateTimePoint(new DateTime(2023,7,8),148446), - new DateTimePoint(new DateTime(2023,7,9),150597), - new DateTimePoint(new DateTime(2023,7,10),153647), - new DateTimePoint(new DateTime(2023,7,11),157093), - new DateTimePoint(new DateTime(2023,7,12),160186), - new DateTimePoint(new DateTime(2023,7,13),163917), - new DateTimePoint(new DateTime(2023,7,14),168512), - new DateTimePoint(new DateTime(2023,7,15),172295), - new DateTimePoint(new DateTime(2023,7,16),175710), - new DateTimePoint(new DateTime(2023,7,17),179513), - new DateTimePoint(new DateTime(2023,7,18),184116), - new DateTimePoint(new DateTime(2023,7,19),189763), - new DateTimePoint(new DateTime(2023,7,20),196544), - new DateTimePoint(new DateTime(2023,7,21),204157), - new DateTimePoint(new DateTime(2023,7,22),212795), - new DateTimePoint(new DateTime(2023,7,23),222193), - new DateTimePoint(new DateTime(2023,7,24),235236), - new DateTimePoint(new DateTime(2023,7,25),248850), - new DateTimePoint(new DateTime(2023,7,26),263258), - new DateTimePoint(new DateTime(2023,7,27),276464), - new DateTimePoint(new DateTime(2023,7,28),288535), - new DateTimePoint(new DateTime(2023,7,29),297992), - new DateTimePoint(new DateTime(2023,7,30),305972), - new DateTimePoint(new DateTime(2023,7,31),315237), - new DateTimePoint(new DateTime(2023,8,1),325214), - new DateTimePoint(new DateTime(2023,8,2),334877), - new DateTimePoint(new DateTime(2023,8,3),344326), - new DateTimePoint(new DateTime(2023,8,4),353915), - new DateTimePoint(new DateTime(2023,8,5),362452), - new DateTimePoint(new DateTime(2023,8,6),370656), - new DateTimePoint(new DateTime(2023,8,7),378475), - new DateTimePoint(new DateTime(2023,8,8),385840), - new DateTimePoint(new DateTime(2023,8,9),393011), - new DateTimePoint(new DateTime(2023,8,10),399597), - new DateTimePoint(new DateTime(2023,8,11),408029), - new DateTimePoint(new DateTime(2023,8,12),415252), - new DateTimePoint(new DateTime(2023,8,13),422190), - new DateTimePoint(new DateTime(2023,8,14),430323), - new DateTimePoint(new DateTime(2023,8,15),437911), - new DateTimePoint(new DateTime(2023,8,16),445220), - new DateTimePoint(new DateTime(2023,8,17),452240), - new DateTimePoint(new DateTime(2023,8,18),459013), - new DateTimePoint(new DateTime(2023,8,19),466396), - new DateTimePoint(new DateTime(2023,8,20),473270), - new DateTimePoint(new DateTime(2023,8,21),480397), - new DateTimePoint(new DateTime(2023,8,22),487281), - new DateTimePoint(new DateTime(2023,8,23),493986), - new DateTimePoint(new DateTime(2023,8,24),500668), - new DateTimePoint(new DateTime(2023,8,25),506307), - new DateTimePoint(new DateTime(2023,8,26),511414), - new DateTimePoint(new DateTime(2023,8,27),516791), - new DateTimePoint(new DateTime(2023,8,28),522633), - new DateTimePoint(new DateTime(2023,8,29),528773), - new DateTimePoint(new DateTime(2023,8,30),534577), - new DateTimePoint(new DateTime(2023,8,31),540014), - new DateTimePoint(new DateTime(2023,9,1),544844), - new DateTimePoint(new DateTime(2023,9,2),549386), - new DateTimePoint(new DateTime(2023,9,3),553736), - new DateTimePoint(new DateTime(2023,9,4),558571), - new DateTimePoint(new DateTime(2023,9,5),563597), - new DateTimePoint(new DateTime(2023,9,6),568419), - new DateTimePoint(new DateTime(2023,9,7),573457), - new DateTimePoint(new DateTime(2023,9,8),577852), - new DateTimePoint(new DateTime(2023,9,9),581606), - new DateTimePoint(new DateTime(2023,9,10),585527), - new DateTimePoint(new DateTime(2023,9,11),589877), - new DateTimePoint(new DateTime(2023,9,12),594110), - new DateTimePoint(new DateTime(2023,9,13),598204), - new DateTimePoint(new DateTime(2023,9,14),602519), - new DateTimePoint(new DateTime(2023,9,15),608068), - new DateTimePoint(new DateTime(2023,9,16),612936), - new DateTimePoint(new DateTime(2023,9,17),617421), - new DateTimePoint(new DateTime(2023,9,18),622982), - new DateTimePoint(new DateTime(2023,9,19),628703), - new DateTimePoint(new DateTime(2023,9,20),634373), - new DateTimePoint(new DateTime(2023,9,21),639188), - new DateTimePoint(new DateTime(2023,9,22),644091), - new DateTimePoint(new DateTime(2023,9,23),648549), - new DateTimePoint(new DateTime(2023,9,24),652723), - new DateTimePoint(new DateTime(2023,9,25),657303), - new DateTimePoint(new DateTime(2023,9,26),662125), - new DateTimePoint(new DateTime(2023,9,27),667228), - new DateTimePoint(new DateTime(2023,9,28),671924), - new DateTimePoint(new DateTime(2023,9,29),676848), - new DateTimePoint(new DateTime(2023,9,30),681323), - new DateTimePoint(new DateTime(2023,10,1),685859), - new DateTimePoint(new DateTime(2023,10,2),691140), - new DateTimePoint(new DateTime(2023,10,3),696085), - new DateTimePoint(new DateTime(2023,10,4),701071), - new DateTimePoint(new DateTime(2023,10,5),705748), - new DateTimePoint(new DateTime(2023,10,6),710785), - new DateTimePoint(new DateTime(2023,10,7),715011), - new DateTimePoint(new DateTime(2023,10,8),718910), - new DateTimePoint(new DateTime(2023,10,9),723553), - new DateTimePoint(new DateTime(2023,10,10),728616), - new DateTimePoint(new DateTime(2023,10,11),734259), - new DateTimePoint(new DateTime(2023,10,12),739637), - new DateTimePoint(new DateTime(2023,10,13),746087), - new DateTimePoint(new DateTime(2023,10,14),752310), - new DateTimePoint(new DateTime(2023,10,15),758207), - new DateTimePoint(new DateTime(2023,10,16),765774), - new DateTimePoint(new DateTime(2023,10,17),772873), - new DateTimePoint(new DateTime(2023,10,18),780601), - new DateTimePoint(new DateTime(2023,10,19),787747), - new DateTimePoint(new DateTime(2023,10,20),795338), - new DateTimePoint(new DateTime(2023,10,21),802464), - new DateTimePoint(new DateTime(2023,10,22),809772), - new DateTimePoint(new DateTime(2023,10,23),818121), - new DateTimePoint(new DateTime(2023,10,24),826055), - new DateTimePoint(new DateTime(2023,10,25),833286), - new DateTimePoint(new DateTime(2023,10,26),839876), - new DateTimePoint(new DateTime(2023,10,27),846324), - new DateTimePoint(new DateTime(2023,10,28),852765), - new DateTimePoint(new DateTime(2023,10,29),858731), - new DateTimePoint(new DateTime(2023,10,30),865884), - new DateTimePoint(new DateTime(2023,10,31),873096), - new DateTimePoint(new DateTime(2023,11,1),880214), - new DateTimePoint(new DateTime(2023,11,2),886989), - new DateTimePoint(new DateTime(2023,11,3),894542), - new DateTimePoint(new DateTime(2023,11,4),902319), - new DateTimePoint(new DateTime(2023,11,5),910287), - new DateTimePoint(new DateTime(2023,11,6),919122), - new DateTimePoint(new DateTime(2023,11,7),927691), - new DateTimePoint(new DateTime(2023,11,8),936678), - new DateTimePoint(new DateTime(2023,11,9),945841), - new DateTimePoint(new DateTime(2023,11,10),954755), - new DateTimePoint(new DateTime(2023,11,11),962277), + Name="Total number of posts", + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), + Stroke = new SolidColorPaint(Colors.SerieBlue,4), + GeometryStroke = null, + GeometrySize = 0, + Fill = null, + LineSmoothness = 1, + ScalesYAt = 0, // it will be scaled at the Axis[0] instance + ScalesXAt = 0, + Values = new List + { + new DateTimePoint(new DateTime(2023,5,6),638), + new DateTimePoint(new DateTime(2023,5,7),1763), + new DateTimePoint(new DateTime(2023,5,8),3341), + new DateTimePoint(new DateTime(2023,5,9),4540), + new DateTimePoint(new DateTime(2023,5,10),5527), + new DateTimePoint(new DateTime(2023,5,11),6326), + new DateTimePoint(new DateTime(2023,5,12),6945), + new DateTimePoint(new DateTime(2023,5,13),7496), + new DateTimePoint(new DateTime(2023,5,14),7985), + new DateTimePoint(new DateTime(2023,5,15),8856), + new DateTimePoint(new DateTime(2023,5,16),9347), + new DateTimePoint(new DateTime(2023,5,17),10023), + new DateTimePoint(new DateTime(2023,5,18),10401), + new DateTimePoint(new DateTime(2023,5,19),10766), + new DateTimePoint(new DateTime(2023,5,20),11178), + new DateTimePoint(new DateTime(2023,5,21),11587), + new DateTimePoint(new DateTime(2023,5,22),12083), + new DateTimePoint(new DateTime(2023,5,23),12630), + new DateTimePoint(new DateTime(2023,5,24),13250), + new DateTimePoint(new DateTime(2023,5,25),14884), + new DateTimePoint(new DateTime(2023,5,26),17181), + new DateTimePoint(new DateTime(2023,5,27),18952), + new DateTimePoint(new DateTime(2023,5,28),21278), + new DateTimePoint(new DateTime(2023,5,29),23950), + new DateTimePoint(new DateTime(2023,5,30),25703), + new DateTimePoint(new DateTime(2023,5,31),27228), + new DateTimePoint(new DateTime(2023,6,1),28508), + new DateTimePoint(new DateTime(2023,6,2),30413), + new DateTimePoint(new DateTime(2023,6,3),32007), + new DateTimePoint(new DateTime(2023,6,4),33520), + new DateTimePoint(new DateTime(2023,6,5),35856), + new DateTimePoint(new DateTime(2023,6,6),37791), + new DateTimePoint(new DateTime(2023,6,7),39439), + new DateTimePoint(new DateTime(2023,6,8),40918), + new DateTimePoint(new DateTime(2023,6,9),42443), + new DateTimePoint(new DateTime(2023,6,10),43957), + new DateTimePoint(new DateTime(2023,6,11),45597), + new DateTimePoint(new DateTime(2023,6,12),47266), + new DateTimePoint(new DateTime(2023,6,13),48807), + new DateTimePoint(new DateTime(2023,6,14),50274), + new DateTimePoint(new DateTime(2023,6,15),51475), + new DateTimePoint(new DateTime(2023,6,16),57516), + new DateTimePoint(new DateTime(2023,6,17),72474), + new DateTimePoint(new DateTime(2023,6,18),85820), + new DateTimePoint(new DateTime(2023,6,19),101707), + new DateTimePoint(new DateTime(2023,6,20),105394), + new DateTimePoint(new DateTime(2023,6,21),110365), + new DateTimePoint(new DateTime(2023,6,22),112705), + new DateTimePoint(new DateTime(2023,6,23),114249), + new DateTimePoint(new DateTime(2023,6,24),116283), + new DateTimePoint(new DateTime(2023,6,25),121170), + new DateTimePoint(new DateTime(2023,6,26),123795), + new DateTimePoint(new DateTime(2023,6,27),126223), + new DateTimePoint(new DateTime(2023,6,28),128325), + new DateTimePoint(new DateTime(2023,6,29),130130), + new DateTimePoint(new DateTime(2023,6,30),131936), + new DateTimePoint(new DateTime(2023,7,1),134043), + new DateTimePoint(new DateTime(2023,7,2),136136), + new DateTimePoint(new DateTime(2023,7,3),138137), + new DateTimePoint(new DateTime(2023,7,4),140066), + new DateTimePoint(new DateTime(2023,7,5),142108), + new DateTimePoint(new DateTime(2023,7,6),144664), + new DateTimePoint(new DateTime(2023,7,7),146693), + new DateTimePoint(new DateTime(2023,7,8),148446), + new DateTimePoint(new DateTime(2023,7,9),150597), + new DateTimePoint(new DateTime(2023,7,10),153647), + new DateTimePoint(new DateTime(2023,7,11),157093), + new DateTimePoint(new DateTime(2023,7,12),160186), + new DateTimePoint(new DateTime(2023,7,13),163917), + new DateTimePoint(new DateTime(2023,7,14),168512), + new DateTimePoint(new DateTime(2023,7,15),172295), + new DateTimePoint(new DateTime(2023,7,16),175710), + new DateTimePoint(new DateTime(2023,7,17),179513), + new DateTimePoint(new DateTime(2023,7,18),184116), + new DateTimePoint(new DateTime(2023,7,19),189763), + new DateTimePoint(new DateTime(2023,7,20),196544), + new DateTimePoint(new DateTime(2023,7,21),204157), + new DateTimePoint(new DateTime(2023,7,22),212795), + new DateTimePoint(new DateTime(2023,7,23),222193), + new DateTimePoint(new DateTime(2023,7,24),235236), + new DateTimePoint(new DateTime(2023,7,25),248850), + new DateTimePoint(new DateTime(2023,7,26),263258), + new DateTimePoint(new DateTime(2023,7,27),276464), + new DateTimePoint(new DateTime(2023,7,28),288535), + new DateTimePoint(new DateTime(2023,7,29),297992), + new DateTimePoint(new DateTime(2023,7,30),305972), + new DateTimePoint(new DateTime(2023,7,31),315237), + new DateTimePoint(new DateTime(2023,8,1),325214), + new DateTimePoint(new DateTime(2023,8,2),334877), + new DateTimePoint(new DateTime(2023,8,3),344326), + new DateTimePoint(new DateTime(2023,8,4),353915), + new DateTimePoint(new DateTime(2023,8,5),362452), + new DateTimePoint(new DateTime(2023,8,6),370656), + new DateTimePoint(new DateTime(2023,8,7),378475), + new DateTimePoint(new DateTime(2023,8,8),385840), + new DateTimePoint(new DateTime(2023,8,9),393011), + new DateTimePoint(new DateTime(2023,8,10),399597), + new DateTimePoint(new DateTime(2023,8,11),408029), + new DateTimePoint(new DateTime(2023,8,12),415252), + new DateTimePoint(new DateTime(2023,8,13),422190), + new DateTimePoint(new DateTime(2023,8,14),430323), + new DateTimePoint(new DateTime(2023,8,15),437911), + new DateTimePoint(new DateTime(2023,8,16),445220), + new DateTimePoint(new DateTime(2023,8,17),452240), + new DateTimePoint(new DateTime(2023,8,18),459013), + new DateTimePoint(new DateTime(2023,8,19),466396), + new DateTimePoint(new DateTime(2023,8,20),473270), + new DateTimePoint(new DateTime(2023,8,21),480397), + new DateTimePoint(new DateTime(2023,8,22),487281), + new DateTimePoint(new DateTime(2023,8,23),493986), + new DateTimePoint(new DateTime(2023,8,24),500668), + new DateTimePoint(new DateTime(2023,8,25),506307), + new DateTimePoint(new DateTime(2023,8,26),511414), + new DateTimePoint(new DateTime(2023,8,27),516791), + new DateTimePoint(new DateTime(2023,8,28),522633), + new DateTimePoint(new DateTime(2023,8,29),528773), + new DateTimePoint(new DateTime(2023,8,30),534577), + new DateTimePoint(new DateTime(2023,8,31),540014), + new DateTimePoint(new DateTime(2023,9,1),544844), + new DateTimePoint(new DateTime(2023,9,2),549386), + new DateTimePoint(new DateTime(2023,9,3),553736), + new DateTimePoint(new DateTime(2023,9,4),558571), + new DateTimePoint(new DateTime(2023,9,5),563597), + new DateTimePoint(new DateTime(2023,9,6),568419), + new DateTimePoint(new DateTime(2023,9,7),573457), + new DateTimePoint(new DateTime(2023,9,8),577852), + new DateTimePoint(new DateTime(2023,9,9),581606), + new DateTimePoint(new DateTime(2023,9,10),585527), + new DateTimePoint(new DateTime(2023,9,11),589877), + new DateTimePoint(new DateTime(2023,9,12),594110), + new DateTimePoint(new DateTime(2023,9,13),598204), + new DateTimePoint(new DateTime(2023,9,14),602519), + new DateTimePoint(new DateTime(2023,9,15),608068), + new DateTimePoint(new DateTime(2023,9,16),612936), + new DateTimePoint(new DateTime(2023,9,17),617421), + new DateTimePoint(new DateTime(2023,9,18),622982), + new DateTimePoint(new DateTime(2023,9,19),628703), + new DateTimePoint(new DateTime(2023,9,20),634373), + new DateTimePoint(new DateTime(2023,9,21),639188), + new DateTimePoint(new DateTime(2023,9,22),644091), + new DateTimePoint(new DateTime(2023,9,23),648549), + new DateTimePoint(new DateTime(2023,9,24),652723), + new DateTimePoint(new DateTime(2023,9,25),657303), + new DateTimePoint(new DateTime(2023,9,26),662125), + new DateTimePoint(new DateTime(2023,9,27),667228), + new DateTimePoint(new DateTime(2023,9,28),671924), + new DateTimePoint(new DateTime(2023,9,29),676848), + new DateTimePoint(new DateTime(2023,9,30),681323), + new DateTimePoint(new DateTime(2023,10,1),685859), + new DateTimePoint(new DateTime(2023,10,2),691140), + new DateTimePoint(new DateTime(2023,10,3),696085), + new DateTimePoint(new DateTime(2023,10,4),701071), + new DateTimePoint(new DateTime(2023,10,5),705748), + new DateTimePoint(new DateTime(2023,10,6),710785), + new DateTimePoint(new DateTime(2023,10,7),715011), + new DateTimePoint(new DateTime(2023,10,8),718910), + new DateTimePoint(new DateTime(2023,10,9),723553), + new DateTimePoint(new DateTime(2023,10,10),728616), + new DateTimePoint(new DateTime(2023,10,11),734259), + new DateTimePoint(new DateTime(2023,10,12),739637), + new DateTimePoint(new DateTime(2023,10,13),746087), + new DateTimePoint(new DateTime(2023,10,14),752310), + new DateTimePoint(new DateTime(2023,10,15),758207), + new DateTimePoint(new DateTime(2023,10,16),765774), + new DateTimePoint(new DateTime(2023,10,17),772873), + new DateTimePoint(new DateTime(2023,10,18),780601), + new DateTimePoint(new DateTime(2023,10,19),787747), + new DateTimePoint(new DateTime(2023,10,20),795338), + new DateTimePoint(new DateTime(2023,10,21),802464), + new DateTimePoint(new DateTime(2023,10,22),809772), + new DateTimePoint(new DateTime(2023,10,23),818121), + new DateTimePoint(new DateTime(2023,10,24),826055), + new DateTimePoint(new DateTime(2023,10,25),833286), + new DateTimePoint(new DateTime(2023,10,26),839876), + new DateTimePoint(new DateTime(2023,10,27),846324), + new DateTimePoint(new DateTime(2023,10,28),852765), + new DateTimePoint(new DateTime(2023,10,29),858731), + new DateTimePoint(new DateTime(2023,10,30),865884), + new DateTimePoint(new DateTime(2023,10,31),873096), + new DateTimePoint(new DateTime(2023,11,1),880214), + new DateTimePoint(new DateTime(2023,11,2),886989), + new DateTimePoint(new DateTime(2023,11,3),894542), + new DateTimePoint(new DateTime(2023,11,4),902319), + new DateTimePoint(new DateTime(2023,11,5),910287), + new DateTimePoint(new DateTime(2023,11,6),919122), + new DateTimePoint(new DateTime(2023,11,7),927691), + new DateTimePoint(new DateTime(2023,11,8),936678), + new DateTimePoint(new DateTime(2023,11,9),945841), + new DateTimePoint(new DateTime(2023,11,10),954755), + new DateTimePoint(new DateTime(2023,11,11),962277), + } + }, + new LineSeries + { + Name = "Total number of post authors", + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), + Fill = null, + Stroke = new SolidColorPaint(Colors.SerieRed,4), + GeometryStroke = null, + GeometrySize = 0, + LineSmoothness = 1, + ScalesXAt = 0, + ScalesYAt = 1, // it will be scaled at the Axis[0] instance + Values = new List + { + new DateTimePoint(new DateTime(2023,5,6),498), + new DateTimePoint(new DateTime(2023,5,7),1297), + new DateTimePoint(new DateTime(2023,5,8),2350), + new DateTimePoint(new DateTime(2023,5,9),3093), + new DateTimePoint(new DateTime(2023,5,10),3649), + new DateTimePoint(new DateTime(2023,5,11),4100), + new DateTimePoint(new DateTime(2023,5,12),4425), + new DateTimePoint(new DateTime(2023,5,13),4709), + new DateTimePoint(new DateTime(2023,5,14),4923), + new DateTimePoint(new DateTime(2023,5,15),5274), + new DateTimePoint(new DateTime(2023,5,16),5484), + new DateTimePoint(new DateTime(2023,5,17),5753), + new DateTimePoint(new DateTime(2023,5,18),5896), + new DateTimePoint(new DateTime(2023,5,19),6032), + new DateTimePoint(new DateTime(2023,5,20),6145), + new DateTimePoint(new DateTime(2023,5,21),6277), + new DateTimePoint(new DateTime(2023,5,22),6454), + new DateTimePoint(new DateTime(2023,5,23),6673), + new DateTimePoint(new DateTime(2023,5,24),6871), + new DateTimePoint(new DateTime(2023,5,25),7718), + new DateTimePoint(new DateTime(2023,5,26),8632), + new DateTimePoint(new DateTime(2023,5,27),9313), + new DateTimePoint(new DateTime(2023,5,28),10225), + new DateTimePoint(new DateTime(2023,5,29),11377), + new DateTimePoint(new DateTime(2023,5,30),11959), + new DateTimePoint(new DateTime(2023,5,31),12394), + new DateTimePoint(new DateTime(2023,6,1),12661), + new DateTimePoint(new DateTime(2023,6,2),13265), + new DateTimePoint(new DateTime(2023,6,3),13694), + new DateTimePoint(new DateTime(2023,6,4),14062), + new DateTimePoint(new DateTime(2023,6,5),14724), + new DateTimePoint(new DateTime(2023,6,6),15148), + new DateTimePoint(new DateTime(2023,6,7),15455), + new DateTimePoint(new DateTime(2023,6,8),15712), + new DateTimePoint(new DateTime(2023,6,9),15990), + new DateTimePoint(new DateTime(2023,6,10),16237), + new DateTimePoint(new DateTime(2023,6,11),16545), + new DateTimePoint(new DateTime(2023,6,12),16770), + new DateTimePoint(new DateTime(2023,6,13),16969), + new DateTimePoint(new DateTime(2023,6,14),17112), + new DateTimePoint(new DateTime(2023,6,15),17225), + new DateTimePoint(new DateTime(2023,6,16),21590), + new DateTimePoint(new DateTime(2023,6,17),34815), + new DateTimePoint(new DateTime(2023,6,18),46588), + new DateTimePoint(new DateTime(2023,6,19),60875), + new DateTimePoint(new DateTime(2023,6,20),62845), + new DateTimePoint(new DateTime(2023,6,21),66053), + new DateTimePoint(new DateTime(2023,6,22),66904), + new DateTimePoint(new DateTime(2023,6,23),67080), + new DateTimePoint(new DateTime(2023,6,24),67972), + new DateTimePoint(new DateTime(2023,6,25),71642), + new DateTimePoint(new DateTime(2023,6,26),72492), + new DateTimePoint(new DateTime(2023,6,27),73114), + new DateTimePoint(new DateTime(2023,6,28),73674), + new DateTimePoint(new DateTime(2023,6,29),74011), + new DateTimePoint(new DateTime(2023,6,30),74264), + new DateTimePoint(new DateTime(2023,7,1),74604), + new DateTimePoint(new DateTime(2023,7,2),74945), + new DateTimePoint(new DateTime(2023,7,3),75188), + new DateTimePoint(new DateTime(2023,7,4),75446), + new DateTimePoint(new DateTime(2023,7,5),75801), + new DateTimePoint(new DateTime(2023,7,6),76157), + new DateTimePoint(new DateTime(2023,7,7),76481), + new DateTimePoint(new DateTime(2023,7,8),76827), + new DateTimePoint(new DateTime(2023,7,9),77320), + new DateTimePoint(new DateTime(2023,7,10),77979), + new DateTimePoint(new DateTime(2023,7,11),78829), + new DateTimePoint(new DateTime(2023,7,12),79602), + new DateTimePoint(new DateTime(2023,7,13),80552), + new DateTimePoint(new DateTime(2023,7,14),81428), + new DateTimePoint(new DateTime(2023,7,15),82064), + new DateTimePoint(new DateTime(2023,7,16),82534), + new DateTimePoint(new DateTime(2023,7,17),82986), + new DateTimePoint(new DateTime(2023,7,18),83675), + new DateTimePoint(new DateTime(2023,7,19),84841), + new DateTimePoint(new DateTime(2023,7,20),86331), + new DateTimePoint(new DateTime(2023,7,21),87818), + new DateTimePoint(new DateTime(2023,7,22),90215), + new DateTimePoint(new DateTime(2023,7,23),92592), + new DateTimePoint(new DateTime(2023,7,24),95858), + new DateTimePoint(new DateTime(2023,7,25),99365), + new DateTimePoint(new DateTime(2023,7,26),103628), + new DateTimePoint(new DateTime(2023,7,27),106250), + new DateTimePoint(new DateTime(2023,7,28),108597), + new DateTimePoint(new DateTime(2023,7,29),110137), + new DateTimePoint(new DateTime(2023,7,30),111380), + new DateTimePoint(new DateTime(2023,7,31),112552), + new DateTimePoint(new DateTime(2023,8,1),114146), + new DateTimePoint(new DateTime(2023,8,2),115307), + new DateTimePoint(new DateTime(2023,8,3),116486), + new DateTimePoint(new DateTime(2023,8,4),117779), + new DateTimePoint(new DateTime(2023,8,5),119094), + new DateTimePoint(new DateTime(2023,8,6),120298), + new DateTimePoint(new DateTime(2023,8,7),121270), + new DateTimePoint(new DateTime(2023,8,8),122025), + new DateTimePoint(new DateTime(2023,8,9),122875), + new DateTimePoint(new DateTime(2023,8,10),123555), + new DateTimePoint(new DateTime(2023,8,11),124776), + new DateTimePoint(new DateTime(2023,8,12),126064), + new DateTimePoint(new DateTime(2023,8,13),127185), + new DateTimePoint(new DateTime(2023,8,14),128145), + new DateTimePoint(new DateTime(2023,8,15),128938), + new DateTimePoint(new DateTime(2023,8,16),129615), + new DateTimePoint(new DateTime(2023,8,17),130219), + new DateTimePoint(new DateTime(2023,8,18),130799), + new DateTimePoint(new DateTime(2023,8,19),131530), + new DateTimePoint(new DateTime(2023,8,20),132337), + new DateTimePoint(new DateTime(2023,8,21),133008), + new DateTimePoint(new DateTime(2023,8,22),133489), + new DateTimePoint(new DateTime(2023,8,23),133944), + new DateTimePoint(new DateTime(2023,8,24),134327), + new DateTimePoint(new DateTime(2023,8,25),134657), + new DateTimePoint(new DateTime(2023,8,26),134969), + new DateTimePoint(new DateTime(2023,8,27),135293), + new DateTimePoint(new DateTime(2023,8,28),135626), + new DateTimePoint(new DateTime(2023,8,29),135872), + new DateTimePoint(new DateTime(2023,8,30),136129), + new DateTimePoint(new DateTime(2023,8,31),136407), + new DateTimePoint(new DateTime(2023,9,1),136573), + new DateTimePoint(new DateTime(2023,9,2),136762), + new DateTimePoint(new DateTime(2023,9,3),136965), + new DateTimePoint(new DateTime(2023,9,4),137216), + new DateTimePoint(new DateTime(2023,9,5),137399), + new DateTimePoint(new DateTime(2023,9,6),137607), + new DateTimePoint(new DateTime(2023,9,7),137815), + new DateTimePoint(new DateTime(2023,9,8),137964), + new DateTimePoint(new DateTime(2023,9,9),138111), + new DateTimePoint(new DateTime(2023,9,10),138287), + new DateTimePoint(new DateTime(2023,9,11),138455), + new DateTimePoint(new DateTime(2023,9,12),138591), + new DateTimePoint(new DateTime(2023,9,13),138754), + new DateTimePoint(new DateTime(2023,9,14),138956), + new DateTimePoint(new DateTime(2023,9,15),139103), + new DateTimePoint(new DateTime(2023,9,16),139332), + new DateTimePoint(new DateTime(2023,9,17),139486), + new DateTimePoint(new DateTime(2023,9,18),139691), + new DateTimePoint(new DateTime(2023,9,19),139894), + new DateTimePoint(new DateTime(2023,9,20),140081), + new DateTimePoint(new DateTime(2023,9,21),140260), + new DateTimePoint(new DateTime(2023,9,22),140409), + new DateTimePoint(new DateTime(2023,9,23),140566), + new DateTimePoint(new DateTime(2023,9,24),140701), + new DateTimePoint(new DateTime(2023,9,25),140844), + new DateTimePoint(new DateTime(2023,9,26),140994), + new DateTimePoint(new DateTime(2023,9,27),141119), + new DateTimePoint(new DateTime(2023,9,28),141241), + new DateTimePoint(new DateTime(2023,9,29),141372), + new DateTimePoint(new DateTime(2023,9,30),141530), + new DateTimePoint(new DateTime(2023,10,1),141691), + new DateTimePoint(new DateTime(2023,10,2),141861), + new DateTimePoint(new DateTime(2023,10,3),141990), + new DateTimePoint(new DateTime(2023,10,4),142094), + new DateTimePoint(new DateTime(2023,10,5),142210), + new DateTimePoint(new DateTime(2023,10,6),142324), + new DateTimePoint(new DateTime(2023,10,7),142429), + new DateTimePoint(new DateTime(2023,10,8),142599), + new DateTimePoint(new DateTime(2023,10,9),142700), + new DateTimePoint(new DateTime(2023,10,10),142829), + new DateTimePoint(new DateTime(2023,10,11),143017), + new DateTimePoint(new DateTime(2023,10,12),143195), + new DateTimePoint(new DateTime(2023,10,13),143366), + new DateTimePoint(new DateTime(2023,10,14),143544), + new DateTimePoint(new DateTime(2023,10,15),143765), + new DateTimePoint(new DateTime(2023,10,16),143957), + new DateTimePoint(new DateTime(2023,10,17),144168), + new DateTimePoint(new DateTime(2023,10,18),144367), + new DateTimePoint(new DateTime(2023,10,19),144524), + new DateTimePoint(new DateTime(2023,10,20),144684), + new DateTimePoint(new DateTime(2023,10,21),144903), + new DateTimePoint(new DateTime(2023,10,22),145447), + new DateTimePoint(new DateTime(2023,10,23),145696), + new DateTimePoint(new DateTime(2023,10,24),145908), + new DateTimePoint(new DateTime(2023,10,25),146078), + new DateTimePoint(new DateTime(2023,10,26),146230), + new DateTimePoint(new DateTime(2023,10,27),146365), + new DateTimePoint(new DateTime(2023,10,28),146535), + new DateTimePoint(new DateTime(2023,10,29),146680), + new DateTimePoint(new DateTime(2023,10,30),146795), + new DateTimePoint(new DateTime(2023,10,31),146918), + new DateTimePoint(new DateTime(2023,11,1),147132), + new DateTimePoint(new DateTime(2023,11,2),147321), + new DateTimePoint(new DateTime(2023,11,3),147458), + new DateTimePoint(new DateTime(2023,11,4),147798), + new DateTimePoint(new DateTime(2023,11,5),147968), + new DateTimePoint(new DateTime(2023,11,6),148176), + new DateTimePoint(new DateTime(2023,11,7),148357), + new DateTimePoint(new DateTime(2023,11,8),148502), + new DateTimePoint(new DateTime(2023,11,9),148645), + new DateTimePoint(new DateTime(2023,11,10),148919), + new DateTimePoint(new DateTime(2023,11,11),149057), + } } - }, - new LineSeries + }; + } + public override byte[] DownloadChartData() + { + var totalPostsSerie = Series[0].As>(); + var totalAuthorsSerie = Series[1].As>(); + + var dailyPostsSerieValues = totalPostsSerie.Values.ToList(); + var dailyAuthorsSerieValues = totalAuthorsSerie.Values.ToList(); + var records = new List(); + + for (int i = 0; i < dailyPostsSerieValues.Count(); i++) { - Name = "Total number of post authors", - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - Fill = null, - Stroke = new SolidColorPaint(Colors.SerieRed,4), - GeometryStroke = null, - GeometrySize = 0, - LineSmoothness = 1, - ScalesXAt = 0, - ScalesYAt = 1, // it will be scaled at the Axis[0] instance - Values = new List + records.Add(new CsvData { - new DateTimePoint(new DateTime(2023,5,6),498), - new DateTimePoint(new DateTime(2023,5,7),1297), - new DateTimePoint(new DateTime(2023,5,8),2350), - new DateTimePoint(new DateTime(2023,5,9),3093), - new DateTimePoint(new DateTime(2023,5,10),3649), - new DateTimePoint(new DateTime(2023,5,11),4100), - new DateTimePoint(new DateTime(2023,5,12),4425), - new DateTimePoint(new DateTime(2023,5,13),4709), - new DateTimePoint(new DateTime(2023,5,14),4923), - new DateTimePoint(new DateTime(2023,5,15),5274), - new DateTimePoint(new DateTime(2023,5,16),5484), - new DateTimePoint(new DateTime(2023,5,17),5753), - new DateTimePoint(new DateTime(2023,5,18),5896), - new DateTimePoint(new DateTime(2023,5,19),6032), - new DateTimePoint(new DateTime(2023,5,20),6145), - new DateTimePoint(new DateTime(2023,5,21),6277), - new DateTimePoint(new DateTime(2023,5,22),6454), - new DateTimePoint(new DateTime(2023,5,23),6673), - new DateTimePoint(new DateTime(2023,5,24),6871), - new DateTimePoint(new DateTime(2023,5,25),7718), - new DateTimePoint(new DateTime(2023,5,26),8632), - new DateTimePoint(new DateTime(2023,5,27),9313), - new DateTimePoint(new DateTime(2023,5,28),10225), - new DateTimePoint(new DateTime(2023,5,29),11377), - new DateTimePoint(new DateTime(2023,5,30),11959), - new DateTimePoint(new DateTime(2023,5,31),12394), - new DateTimePoint(new DateTime(2023,6,1),12661), - new DateTimePoint(new DateTime(2023,6,2),13265), - new DateTimePoint(new DateTime(2023,6,3),13694), - new DateTimePoint(new DateTime(2023,6,4),14062), - new DateTimePoint(new DateTime(2023,6,5),14724), - new DateTimePoint(new DateTime(2023,6,6),15148), - new DateTimePoint(new DateTime(2023,6,7),15455), - new DateTimePoint(new DateTime(2023,6,8),15712), - new DateTimePoint(new DateTime(2023,6,9),15990), - new DateTimePoint(new DateTime(2023,6,10),16237), - new DateTimePoint(new DateTime(2023,6,11),16545), - new DateTimePoint(new DateTime(2023,6,12),16770), - new DateTimePoint(new DateTime(2023,6,13),16969), - new DateTimePoint(new DateTime(2023,6,14),17112), - new DateTimePoint(new DateTime(2023,6,15),17225), - new DateTimePoint(new DateTime(2023,6,16),21590), - new DateTimePoint(new DateTime(2023,6,17),34815), - new DateTimePoint(new DateTime(2023,6,18),46588), - new DateTimePoint(new DateTime(2023,6,19),60875), - new DateTimePoint(new DateTime(2023,6,20),62845), - new DateTimePoint(new DateTime(2023,6,21),66053), - new DateTimePoint(new DateTime(2023,6,22),66904), - new DateTimePoint(new DateTime(2023,6,23),67080), - new DateTimePoint(new DateTime(2023,6,24),67972), - new DateTimePoint(new DateTime(2023,6,25),71642), - new DateTimePoint(new DateTime(2023,6,26),72492), - new DateTimePoint(new DateTime(2023,6,27),73114), - new DateTimePoint(new DateTime(2023,6,28),73674), - new DateTimePoint(new DateTime(2023,6,29),74011), - new DateTimePoint(new DateTime(2023,6,30),74264), - new DateTimePoint(new DateTime(2023,7,1),74604), - new DateTimePoint(new DateTime(2023,7,2),74945), - new DateTimePoint(new DateTime(2023,7,3),75188), - new DateTimePoint(new DateTime(2023,7,4),75446), - new DateTimePoint(new DateTime(2023,7,5),75801), - new DateTimePoint(new DateTime(2023,7,6),76157), - new DateTimePoint(new DateTime(2023,7,7),76481), - new DateTimePoint(new DateTime(2023,7,8),76827), - new DateTimePoint(new DateTime(2023,7,9),77320), - new DateTimePoint(new DateTime(2023,7,10),77979), - new DateTimePoint(new DateTime(2023,7,11),78829), - new DateTimePoint(new DateTime(2023,7,12),79602), - new DateTimePoint(new DateTime(2023,7,13),80552), - new DateTimePoint(new DateTime(2023,7,14),81428), - new DateTimePoint(new DateTime(2023,7,15),82064), - new DateTimePoint(new DateTime(2023,7,16),82534), - new DateTimePoint(new DateTime(2023,7,17),82986), - new DateTimePoint(new DateTime(2023,7,18),83675), - new DateTimePoint(new DateTime(2023,7,19),84841), - new DateTimePoint(new DateTime(2023,7,20),86331), - new DateTimePoint(new DateTime(2023,7,21),87818), - new DateTimePoint(new DateTime(2023,7,22),90215), - new DateTimePoint(new DateTime(2023,7,23),92592), - new DateTimePoint(new DateTime(2023,7,24),95858), - new DateTimePoint(new DateTime(2023,7,25),99365), - new DateTimePoint(new DateTime(2023,7,26),103628), - new DateTimePoint(new DateTime(2023,7,27),106250), - new DateTimePoint(new DateTime(2023,7,28),108597), - new DateTimePoint(new DateTime(2023,7,29),110137), - new DateTimePoint(new DateTime(2023,7,30),111380), - new DateTimePoint(new DateTime(2023,7,31),112552), - new DateTimePoint(new DateTime(2023,8,1),114146), - new DateTimePoint(new DateTime(2023,8,2),115307), - new DateTimePoint(new DateTime(2023,8,3),116486), - new DateTimePoint(new DateTime(2023,8,4),117779), - new DateTimePoint(new DateTime(2023,8,5),119094), - new DateTimePoint(new DateTime(2023,8,6),120298), - new DateTimePoint(new DateTime(2023,8,7),121270), - new DateTimePoint(new DateTime(2023,8,8),122025), - new DateTimePoint(new DateTime(2023,8,9),122875), - new DateTimePoint(new DateTime(2023,8,10),123555), - new DateTimePoint(new DateTime(2023,8,11),124776), - new DateTimePoint(new DateTime(2023,8,12),126064), - new DateTimePoint(new DateTime(2023,8,13),127185), - new DateTimePoint(new DateTime(2023,8,14),128145), - new DateTimePoint(new DateTime(2023,8,15),128938), - new DateTimePoint(new DateTime(2023,8,16),129615), - new DateTimePoint(new DateTime(2023,8,17),130219), - new DateTimePoint(new DateTime(2023,8,18),130799), - new DateTimePoint(new DateTime(2023,8,19),131530), - new DateTimePoint(new DateTime(2023,8,20),132337), - new DateTimePoint(new DateTime(2023,8,21),133008), - new DateTimePoint(new DateTime(2023,8,22),133489), - new DateTimePoint(new DateTime(2023,8,23),133944), - new DateTimePoint(new DateTime(2023,8,24),134327), - new DateTimePoint(new DateTime(2023,8,25),134657), - new DateTimePoint(new DateTime(2023,8,26),134969), - new DateTimePoint(new DateTime(2023,8,27),135293), - new DateTimePoint(new DateTime(2023,8,28),135626), - new DateTimePoint(new DateTime(2023,8,29),135872), - new DateTimePoint(new DateTime(2023,8,30),136129), - new DateTimePoint(new DateTime(2023,8,31),136407), - new DateTimePoint(new DateTime(2023,9,1),136573), - new DateTimePoint(new DateTime(2023,9,2),136762), - new DateTimePoint(new DateTime(2023,9,3),136965), - new DateTimePoint(new DateTime(2023,9,4),137216), - new DateTimePoint(new DateTime(2023,9,5),137399), - new DateTimePoint(new DateTime(2023,9,6),137607), - new DateTimePoint(new DateTime(2023,9,7),137815), - new DateTimePoint(new DateTime(2023,9,8),137964), - new DateTimePoint(new DateTime(2023,9,9),138111), - new DateTimePoint(new DateTime(2023,9,10),138287), - new DateTimePoint(new DateTime(2023,9,11),138455), - new DateTimePoint(new DateTime(2023,9,12),138591), - new DateTimePoint(new DateTime(2023,9,13),138754), - new DateTimePoint(new DateTime(2023,9,14),138956), - new DateTimePoint(new DateTime(2023,9,15),139103), - new DateTimePoint(new DateTime(2023,9,16),139332), - new DateTimePoint(new DateTime(2023,9,17),139486), - new DateTimePoint(new DateTime(2023,9,18),139691), - new DateTimePoint(new DateTime(2023,9,19),139894), - new DateTimePoint(new DateTime(2023,9,20),140081), - new DateTimePoint(new DateTime(2023,9,21),140260), - new DateTimePoint(new DateTime(2023,9,22),140409), - new DateTimePoint(new DateTime(2023,9,23),140566), - new DateTimePoint(new DateTime(2023,9,24),140701), - new DateTimePoint(new DateTime(2023,9,25),140844), - new DateTimePoint(new DateTime(2023,9,26),140994), - new DateTimePoint(new DateTime(2023,9,27),141119), - new DateTimePoint(new DateTime(2023,9,28),141241), - new DateTimePoint(new DateTime(2023,9,29),141372), - new DateTimePoint(new DateTime(2023,9,30),141530), - new DateTimePoint(new DateTime(2023,10,1),141691), - new DateTimePoint(new DateTime(2023,10,2),141861), - new DateTimePoint(new DateTime(2023,10,3),141990), - new DateTimePoint(new DateTime(2023,10,4),142094), - new DateTimePoint(new DateTime(2023,10,5),142210), - new DateTimePoint(new DateTime(2023,10,6),142324), - new DateTimePoint(new DateTime(2023,10,7),142429), - new DateTimePoint(new DateTime(2023,10,8),142599), - new DateTimePoint(new DateTime(2023,10,9),142700), - new DateTimePoint(new DateTime(2023,10,10),142829), - new DateTimePoint(new DateTime(2023,10,11),143017), - new DateTimePoint(new DateTime(2023,10,12),143195), - new DateTimePoint(new DateTime(2023,10,13),143366), - new DateTimePoint(new DateTime(2023,10,14),143544), - new DateTimePoint(new DateTime(2023,10,15),143765), - new DateTimePoint(new DateTime(2023,10,16),143957), - new DateTimePoint(new DateTime(2023,10,17),144168), - new DateTimePoint(new DateTime(2023,10,18),144367), - new DateTimePoint(new DateTime(2023,10,19),144524), - new DateTimePoint(new DateTime(2023,10,20),144684), - new DateTimePoint(new DateTime(2023,10,21),144903), - new DateTimePoint(new DateTime(2023,10,22),145447), - new DateTimePoint(new DateTime(2023,10,23),145696), - new DateTimePoint(new DateTime(2023,10,24),145908), - new DateTimePoint(new DateTime(2023,10,25),146078), - new DateTimePoint(new DateTime(2023,10,26),146230), - new DateTimePoint(new DateTime(2023,10,27),146365), - new DateTimePoint(new DateTime(2023,10,28),146535), - new DateTimePoint(new DateTime(2023,10,29),146680), - new DateTimePoint(new DateTime(2023,10,30),146795), - new DateTimePoint(new DateTime(2023,10,31),146918), - new DateTimePoint(new DateTime(2023,11,1),147132), - new DateTimePoint(new DateTime(2023,11,2),147321), - new DateTimePoint(new DateTime(2023,11,3),147458), - new DateTimePoint(new DateTime(2023,11,4),147798), - new DateTimePoint(new DateTime(2023,11,5),147968), - new DateTimePoint(new DateTime(2023,11,6),148176), - new DateTimePoint(new DateTime(2023,11,7),148357), - new DateTimePoint(new DateTime(2023,11,8),148502), - new DateTimePoint(new DateTime(2023,11,9),148645), - new DateTimePoint(new DateTime(2023,11,10),148919), - new DateTimePoint(new DateTime(2023,11,11),149057), - } + Date = dailyPostsSerieValues[i].DateTime, + TotalPosts = dailyPostsSerieValues[i].Value, + TotalAuthors = dailyAuthorsSerieValues[i].Value, + }); } - }; + + using (var stream = new MemoryStream()) + using (var writer = new StreamWriter(stream)) + using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) + { + csv.WriteRecords(records); + writer.Flush(); + return stream.ToArray(); + } + } + + private class CsvData + { + public DateTime Date { get; set; } + public double? TotalPosts { get; set; } + public double? TotalAuthors { get; set; } + } } } diff --git a/DeBankUI/Shared/Michal/Web3RegistrationsChart.razor.cs b/DeBankUI/Shared/Michal/Web3RegistrationsChart.razor.cs index 9623754..f13f217 100644 --- a/DeBankUI/Shared/Michal/Web3RegistrationsChart.razor.cs +++ b/DeBankUI/Shared/Michal/Web3RegistrationsChart.razor.cs @@ -1,162 +1,199 @@ -using DeBankUI.Components; +using CsvHelper; +using DeBankUI.Components; using DeBankUI.Utils; using LiveChartsCore; using LiveChartsCore.Defaults; using LiveChartsCore.SkiaSharpView; using LiveChartsCore.SkiaSharpView.Painting; +using MudBlazor.Extensions; using SkiaSharp; +using System.Globalization; namespace DeBankUI.Shared.Michal { public partial class Web3RegistrationsChart : BaseChartComponent { private static readonly SKColor black = SKColors.Black; - private DrawMarginFrame DrawMarginFrame => new() - { - Fill = new SolidColorPaint(Colors.ChartBackground), - Stroke = new SolidColorPaint(Colors.ChartBorder, 2) - }; - - private Axis[] XAxes { get; set; } = - { - new DateTimeAxis(TimeSpan.FromDays(1), date => date.ToString("yyyy-MM-dd")) - { - LabelsRotation = 30, - TicksPaint = new SolidColorPaint(black), - NamePaint = new SolidColorPaint(black), - LabelsPaint = new SolidColorPaint(black), - } - }; - private Axis[] YAxes { get; set; } = + public Web3RegistrationsChart() { - new Axis - { - Name = "L2 Registrations", - NamePaint = new SolidColorPaint(Colors.SerieBlue), - LabelsPaint = new SolidColorPaint(Colors.SerieBlue), - TicksPaint = new SolidColorPaint(Colors.SerieBlue), - SubticksPaint = new SolidColorPaint(Colors.SerieBlue), - }, - new Axis + XAxes = new[] { - Name = "Web3 ID minters", - ShowSeparatorLines = false, - Position = LiveChartsCore.Measure.AxisPosition.End, - NamePaint = new SolidColorPaint(Colors.SerieRed), - LabelsPaint = new SolidColorPaint(Colors.SerieRed), - TicksPaint = new SolidColorPaint(Colors.SerieRed), - SubticksPaint = new SolidColorPaint(Colors.SerieRed), - }, - }; + new DateTimeAxis(TimeSpan.FromDays(1), date => date.ToString("yyyy-MM-dd")) + { + LabelsRotation = 30, + TicksPaint = new SolidColorPaint(black), + NamePaint = new SolidColorPaint(black), + LabelsPaint = new SolidColorPaint(black), + } + }; + YAxes = new[] + { + new Axis + { + Name = "L2 Registrations", + NamePaint = new SolidColorPaint(Colors.SerieBlue), + LabelsPaint = new SolidColorPaint(Colors.SerieBlue), + TicksPaint = new SolidColorPaint(Colors.SerieBlue), + SubticksPaint = new SolidColorPaint(Colors.SerieBlue), + }, + new Axis + { + Name = "Web3 ID minters", + ShowSeparatorLines = false, + Position = LiveChartsCore.Measure.AxisPosition.End, + NamePaint = new SolidColorPaint(Colors.SerieRed), + LabelsPaint = new SolidColorPaint(Colors.SerieRed), + TicksPaint = new SolidColorPaint(Colors.SerieRed), + SubticksPaint = new SolidColorPaint(Colors.SerieRed), + }, + }; - private ISeries[] Series { get; set; } = - { - new LineSeries + Series = new[] { - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - Stroke = new SolidColorPaint(Colors.SerieBlue,4), - GeometryStroke = null, - GeometrySize = 0, - Fill = null, - LineSmoothness = 1, - ScalesYAt = 0, // it will be scaled at the Axis[0] instance - ScalesXAt = 0, - Values = new List + new LineSeries { - new DateTimePoint(new DateTime(2022,10,24), 539), - new DateTimePoint(new DateTime(2022,10,31), 20672), - new DateTimePoint(new DateTime(2022,11,07), 28876), - new DateTimePoint(new DateTime(2022,11,14), 31521), - new DateTimePoint(new DateTime(2022,11,21), 34705), - new DateTimePoint(new DateTime(2022,11,28), 39110), - new DateTimePoint(new DateTime(2022,12,05), 41159), - new DateTimePoint(new DateTime(2022,12,12), 42203), - new DateTimePoint(new DateTime(2022,12,19), 43229), - new DateTimePoint(new DateTime(2022,12,26), 44208), - new DateTimePoint(new DateTime(2023,01,02), 44936), - new DateTimePoint(new DateTime(2023,01,09), 45310), - new DateTimePoint(new DateTime(2023,01,16), 45657), - new DateTimePoint(new DateTime(2023,01,23), 45958), - new DateTimePoint(new DateTime(2023,01,30), 46276), - new DateTimePoint(new DateTime(2023,02,06), 46653), - new DateTimePoint(new DateTime(2023,02,13), 46939), - new DateTimePoint(new DateTime(2023,02,20), 47380), - new DateTimePoint(new DateTime(2023,02,27), 47784), - new DateTimePoint(new DateTime(2023,03,06), 48112), - new DateTimePoint(new DateTime(2023,03,13), 48380), - new DateTimePoint(new DateTime(2023,03,20), 48895), - new DateTimePoint(new DateTime(2023,03,27), 50845), - new DateTimePoint(new DateTime(2023,04,03), 51649), - new DateTimePoint(new DateTime(2023,04,10), 52317), - new DateTimePoint(new DateTime(2023,04,17), 52862), - new DateTimePoint(new DateTime(2023,04,24), 53177), - new DateTimePoint(new DateTime(2023,05,01), 53854), - new DateTimePoint(new DateTime(2023,05,08), 54070), - new DateTimePoint(new DateTime(2023,05,15), 54409), - new DateTimePoint(new DateTime(2023,05,22), 54824), - new DateTimePoint(new DateTime(2023,05,29), 56322), - new DateTimePoint(new DateTime(2023,06,02), 58116), - new DateTimePoint(new DateTime(2023,06,09), 69334), - new DateTimePoint(new DateTime(2023,06,16), 75824), - new DateTimePoint(new DateTime(2023,06,23), 87330), - new DateTimePoint(new DateTime(2023,06,30), 104738), - new DateTimePoint(new DateTime(2023,07,01), 106024), - new DateTimePoint(new DateTime(2023,07,02), 107307), - new DateTimePoint(new DateTime(2023,07,09), 114977), - new DateTimePoint(new DateTime(2023,07,16), 126114), - new DateTimePoint(new DateTime(2023,07,23), 141826), - new DateTimePoint(new DateTime(2023,07,27), 165175), - new DateTimePoint(new DateTime(2023,08,03), 187732), - new DateTimePoint(new DateTime(2023,08,06), 196115), - new DateTimePoint(new DateTime(2023,08,13), 218884), - new DateTimePoint(new DateTime(2023,08,20), 234723), - new DateTimePoint(new DateTime(2023,08,27), 245133), - new DateTimePoint(new DateTime(2023,09,02), 250159), - new DateTimePoint(new DateTime(2023,09,10), 255539), - new DateTimePoint(new DateTime(2023,09,17), 259327), - new DateTimePoint(new DateTime(2023,09,24), 265032), - new DateTimePoint(new DateTime(2023,10,01), 267819), - new DateTimePoint(new DateTime(2023,10,08), 271499), - new DateTimePoint(new DateTime(2023,10,15), 274182), - new DateTimePoint(new DateTime(2023,10,22), 279303), - new DateTimePoint(new DateTime(2023,10,29), 281531), - new DateTimePoint(new DateTime(2023,11,05), 284974), - new DateTimePoint(new DateTime(2023,11,12), 288020), + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), + Stroke = new SolidColorPaint(Colors.SerieBlue,4), + GeometryStroke = null, + GeometrySize = 0, + Fill = null, + LineSmoothness = 1, + ScalesYAt = 0, // it will be scaled at the Axis[0] instance + ScalesXAt = 0, + Values = new List + { + new DateTimePoint(new DateTime(2022,10,24), 539), + new DateTimePoint(new DateTime(2022,10,31), 20672), + new DateTimePoint(new DateTime(2022,11,07), 28876), + new DateTimePoint(new DateTime(2022,11,14), 31521), + new DateTimePoint(new DateTime(2022,11,21), 34705), + new DateTimePoint(new DateTime(2022,11,28), 39110), + new DateTimePoint(new DateTime(2022,12,05), 41159), + new DateTimePoint(new DateTime(2022,12,12), 42203), + new DateTimePoint(new DateTime(2022,12,19), 43229), + new DateTimePoint(new DateTime(2022,12,26), 44208), + new DateTimePoint(new DateTime(2023,01,02), 44936), + new DateTimePoint(new DateTime(2023,01,09), 45310), + new DateTimePoint(new DateTime(2023,01,16), 45657), + new DateTimePoint(new DateTime(2023,01,23), 45958), + new DateTimePoint(new DateTime(2023,01,30), 46276), + new DateTimePoint(new DateTime(2023,02,06), 46653), + new DateTimePoint(new DateTime(2023,02,13), 46939), + new DateTimePoint(new DateTime(2023,02,20), 47380), + new DateTimePoint(new DateTime(2023,02,27), 47784), + new DateTimePoint(new DateTime(2023,03,06), 48112), + new DateTimePoint(new DateTime(2023,03,13), 48380), + new DateTimePoint(new DateTime(2023,03,20), 48895), + new DateTimePoint(new DateTime(2023,03,27), 50845), + new DateTimePoint(new DateTime(2023,04,03), 51649), + new DateTimePoint(new DateTime(2023,04,10), 52317), + new DateTimePoint(new DateTime(2023,04,17), 52862), + new DateTimePoint(new DateTime(2023,04,24), 53177), + new DateTimePoint(new DateTime(2023,05,01), 53854), + new DateTimePoint(new DateTime(2023,05,08), 54070), + new DateTimePoint(new DateTime(2023,05,15), 54409), + new DateTimePoint(new DateTime(2023,05,22), 54824), + new DateTimePoint(new DateTime(2023,05,29), 56322), + new DateTimePoint(new DateTime(2023,06,02), 58116), + new DateTimePoint(new DateTime(2023,06,09), 69334), + new DateTimePoint(new DateTime(2023,06,16), 75824), + new DateTimePoint(new DateTime(2023,06,23), 87330), + new DateTimePoint(new DateTime(2023,06,30), 104738), + new DateTimePoint(new DateTime(2023,07,01), 106024), + new DateTimePoint(new DateTime(2023,07,02), 107307), + new DateTimePoint(new DateTime(2023,07,09), 114977), + new DateTimePoint(new DateTime(2023,07,16), 126114), + new DateTimePoint(new DateTime(2023,07,23), 141826), + new DateTimePoint(new DateTime(2023,07,27), 165175), + new DateTimePoint(new DateTime(2023,08,03), 187732), + new DateTimePoint(new DateTime(2023,08,06), 196115), + new DateTimePoint(new DateTime(2023,08,13), 218884), + new DateTimePoint(new DateTime(2023,08,20), 234723), + new DateTimePoint(new DateTime(2023,08,27), 245133), + new DateTimePoint(new DateTime(2023,09,02), 250159), + new DateTimePoint(new DateTime(2023,09,10), 255539), + new DateTimePoint(new DateTime(2023,09,17), 259327), + new DateTimePoint(new DateTime(2023,09,24), 265032), + new DateTimePoint(new DateTime(2023,10,01), 267819), + new DateTimePoint(new DateTime(2023,10,08), 271499), + new DateTimePoint(new DateTime(2023,10,15), 274182), + new DateTimePoint(new DateTime(2023,10,22), 279303), + new DateTimePoint(new DateTime(2023,10,29), 281531), + new DateTimePoint(new DateTime(2023,11,05), 284974), + new DateTimePoint(new DateTime(2023,11,12), 288020), + } + }, + new LineSeries + { + DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), + Fill = null, + Stroke = new SolidColorPaint(Colors.SerieRed,4), + GeometryStroke = null, + GeometrySize = 0, + LineSmoothness = 1, + ScalesXAt = 0, + ScalesYAt = 1, // it will be scaled at the Axis[0] instance + Values = new List + { + new DateTimePoint(new DateTime(2023,06,02), 23000), + new DateTimePoint(new DateTime(2023,07,02), 25000), + new DateTimePoint(new DateTime(2023,07,27), 29500), + new DateTimePoint(new DateTime(2023,08,06), 32500), + new DateTimePoint(new DateTime(2023,08,13), 35000), + new DateTimePoint(new DateTime(2023,08,20), 37700), + new DateTimePoint(new DateTime(2023,08,27), 39000), + new DateTimePoint(new DateTime(2023,09,02), 39750), + new DateTimePoint(new DateTime(2023,09,10), 40600), + new DateTimePoint(new DateTime(2023,09,17), 41045), + new DateTimePoint(new DateTime(2023,09,24), 41501), + new DateTimePoint(new DateTime(2023,10,01), 41817), + new DateTimePoint(new DateTime(2023,10,08), 42110), + new DateTimePoint(new DateTime(2023,10,15), 42376), + new DateTimePoint(new DateTime(2023,10,29), 43244), + new DateTimePoint(new DateTime(2023,11,05), 43774), + new DateTimePoint(new DateTime(2023,11,12), 44272), + } } - }, - new LineSeries + }; + } + + public override byte[] DownloadChartData() + { + var l2Serie = Series[0].As>(); + var Web3IdSerie = Series[1].As>(); + + var l2SerieValues = l2Serie.Values.ToList(); + var Web3IdSerieValues = Web3IdSerie.Values.ToList(); + var records = new List(); + + for (int i = 0; i < l2SerieValues.Count(); i++) { - DataPadding = new LiveChartsCore.Drawing.LvcPoint(0,0), - Fill = null, - Stroke = new SolidColorPaint(Colors.SerieRed,4), - GeometryStroke = null, - GeometrySize = 0, - LineSmoothness = 1, - ScalesXAt = 0, - ScalesYAt = 1, // it will be scaled at the Axis[0] instance - Values = new List + var dateTime = l2SerieValues[i].DateTime; + records.Add(new CsvData { - new DateTimePoint(new DateTime(2023,06,02), 23000), - new DateTimePoint(new DateTime(2023,07,02), 25000), - new DateTimePoint(new DateTime(2023,07,27), 29500), - new DateTimePoint(new DateTime(2023,08,06), 32500), - new DateTimePoint(new DateTime(2023,08,13), 35000), - new DateTimePoint(new DateTime(2023,08,20), 37700), - new DateTimePoint(new DateTime(2023,08,27), 39000), - new DateTimePoint(new DateTime(2023,09,02), 39750), - new DateTimePoint(new DateTime(2023,09,10), 40600), - new DateTimePoint(new DateTime(2023,09,17), 41045), - new DateTimePoint(new DateTime(2023,09,24), 41501), - new DateTimePoint(new DateTime(2023,10,01), 41817), - new DateTimePoint(new DateTime(2023,10,08), 42110), - new DateTimePoint(new DateTime(2023,10,15), 42376), - new DateTimePoint(new DateTime(2023,10,29), 43244), - new DateTimePoint(new DateTime(2023,11,05), 43774), - new DateTimePoint(new DateTime(2023,11,12), 44272), - } + Date = dateTime, + L2Users = l2SerieValues[i].Value, + Web3Minters = Web3IdSerieValues.FirstOrDefault(dt => dt.DateTime == dateTime)?.Value, + }); } - }; + + using (var stream = new MemoryStream()) + using (var writer = new StreamWriter(stream)) + using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) + { + csv.WriteRecords(records); + writer.Flush(); + return stream.ToArray(); + } + } + + private class CsvData + { + public DateTime Date { get; set; } + public double? L2Users { get; set; } + public double? Web3Minters { get; set; } + } } }