Annotations are broken. Can't draw on the canvas.
Posted: Tue Oct 29, 2024 5:36 pm
Steema.TeeChart.NET.MAUI v6.2024.8.29
Seems that the following is the culprit:
Seems like the CurrentState is null. It should be an instance of PlatformCanvasState.
AnnotationTool is a sub-classed Steema.TeeChart.Tools.RectangleTool in the stack trace below.
Seems that the following is the culprit:
Code: Select all
Microsoft.Maui.Graphics.Platform.PlatformCanvas
Seems like the CurrentState is null. It should be an instance of PlatformCanvasState.
Code: Select all
public override void FillRectangle(float x, float y, float width, float height)
{
var rectX = x;
var rectY = y;
var rectWidth = width;
var rectHeight = height;
_canvas.DrawRect(rectX, rectY, rectX + rectWidth, rectY + rectHeight, CurrentState.FillPaintWithAlpha);
}
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Maui.Graphics.Platform.PlatformCanvas.FillRectangle(Single x, Single y, Single width, Single height) in /_/src/Graphics/src/Graphics/Platforms/Android/PlatformCanvas.cs:line 473
at Microsoft.Maui.Graphics.ScalingCanvas.FillRectangle(Single x, Single y, Single width, Single height) in /_/src/Graphics/src/Graphics/ScalingCanvas.cs:line 167
at Microsoft.Maui.Graphics.CanvasExtensions.FillRectangle(ICanvas target, Rect rect) in /_/src/Graphics/src/Graphics/CanvasExtensions.cs:line 22
at Steema.TeeChart.Maui.Drawing.CanvasMaui.Rectangle(Rect r)
at <project>.AnnotationTool.DrawText(CanvasMaui& graphics, ReadOnlyRectangle& bounds) in <project>\Graphs\AnnotationTool.cs:line 241
at <project>.AnnotationTool.Draw(CanvasMaui& graphics, Line& line, DashboardResult& result, ReadOnlyPoint& target, ReadOnlyPoint& source, Int32& currentPointIndex, Boolean& floatingAnnotations, Double& annotationOffset, CultureInfo& culture) in <project>\Graphs\AnnotationTool.cs:line 189