diff --git a/CertReports.Syncfusion/Services/Implementations/FundDataService.cs b/CertReports.Syncfusion/Services/Implementations/FundDataService.cs index d05628b..d5e0fa7 100644 --- a/CertReports.Syncfusion/Services/Implementations/FundDataService.cs +++ b/CertReports.Syncfusion/Services/Implementations/FundDataService.cs @@ -66,6 +66,7 @@ public class FundDataService : IFundDataService _logger.LogError(ex, "Errore GetChartPricesAsync per ISIN {Isin}", isin); throw; } + points.Sort((a, b) => a.Date.CompareTo(b.Date)); return points; } diff --git a/CertReports.Syncfusion/Services/Implementations/FundSkiaChartRenderer.cs b/CertReports.Syncfusion/Services/Implementations/FundSkiaChartRenderer.cs index 57d0f84..4e8383f 100644 --- a/CertReports.Syncfusion/Services/Implementations/FundSkiaChartRenderer.cs +++ b/CertReports.Syncfusion/Services/Implementations/FundSkiaChartRenderer.cs @@ -130,9 +130,9 @@ public static class FundSkiaChartRenderer var axisLabelFont = new SKFont(SKTypeface.Default, 10f); // Y grid (5 horizontal lines) - for (int i = 0; i <= 5; i++) + for (int i = 0; i < 5; i++) { - decimal price = yMin + (yMax - yMin) * i / 5; + decimal price = yMin + (yMax - yMin) * i / 4; float py = PriceToY(price, yMin, yMax, plotY, plotH); canvas.DrawLine(plotX, py, plotX + plotW, py, i == 0 ? axisPaint : gridPaint); canvas.DrawText($"{price:F2}", plotX - 5f, py + 4f,