Commit Latest

This commit is contained in:
2025-06-29 08:17:56 -04:00
parent 961eb11e82
commit 029f8a2d87
2 changed files with 1 additions and 3 deletions

View File

@@ -214,7 +214,7 @@ namespace PortfolioManager.Renderers
double parityOffsetPercent = (latestPrice.Close - zeroPrice.Close) / zeroPrice.Close; double parityOffsetPercent = (latestPrice.Close - zeroPrice.Close) / zeroPrice.Close;
sb.Append("(").Append(parityOffsetPercent < 0 ? "" : "+").Append(Utility.FormatPercent(parityOffsetPercent)).Append(")"); sb.Append("(").Append(parityOffsetPercent < 0 ? "" : "+").Append(Utility.FormatPercent(parityOffsetPercent)).Append(")");
image = TextMarkerImageGenerator.GenerateImage(sb.ToString(), 130, 24, FontFactor.FontSize); image = TextMarkerImageGenerator.GenerateImage(sb.ToString(), 130, 24, FontFactor.FontSize);
coordinates = new Coordinates(dates[0].ToOADate() - offsets.Offset(OffsetDictionary.OffsetType.HorizontalOffset3PC), values[0] - offsets.Offset(OffsetDictionary.OffsetType.VerticalOffset5PC)); coordinates = new Coordinates(dates[0].ToOADate() - offsets.Offset(OffsetDictionary.OffsetType.HorizontalOffset1PC), values[0] - offsets.Offset(OffsetDictionary.OffsetType.VerticalOffset5PC));
imageMarker = Plotter.Plot.Add.ImageMarker(coordinates, image); imageMarker = Plotter.Plot.Add.ImageMarker(coordinates, image);
} }

View File

@@ -20,7 +20,6 @@ public static class TextMarkerImageGenerator
imageHelper.DrawLine(SKColors.Black,1, new SKPoint(0,height-1), new SKPoint(width-1,height-1)); // top left to right imageHelper.DrawLine(SKColors.Black,1, new SKPoint(0,height-1), new SKPoint(width-1,height-1)); // top left to right
imageHelper.DrawLine(SKColors.Black,1, new SKPoint(0,height-1), new SKPoint(0,0)); // left hand side top to bottom imageHelper.DrawLine(SKColors.Black,1, new SKPoint(0,height-1), new SKPoint(0,0)); // left hand side top to bottom
imageHelper.DrawText(text, new SKPoint(width / 2, height-8), SKColors.Black, align, font); imageHelper.DrawText(text, new SKPoint(width / 2, height-8), SKColors.Black, align, font);
using MemoryStream memoryStream = new MemoryStream(); using MemoryStream memoryStream = new MemoryStream();
imageHelper.ToStream().CopyTo(memoryStream); imageHelper.ToStream().CopyTo(memoryStream);
return new ScottPlot.Image(memoryStream.ToArray()); return new ScottPlot.Image(memoryStream.ToArray());
@@ -41,6 +40,5 @@ public static class TextMarkerImageGenerator
imageHelper.Fill(color); imageHelper.Fill(color);
Avalonia.Media.Imaging.Bitmap avBitmap = new Avalonia.Media.Imaging.Bitmap(imageHelper.ToStream()); Avalonia.Media.Imaging.Bitmap avBitmap = new Avalonia.Media.Imaging.Bitmap(imageHelper.ToStream());
return avBitmap; return avBitmap;
// avBitmap.Save("c:\\3\\mybitmap.jpg"); }
} }
} }