Objects also have reference to their unmanaged counterparts, like GPU resources. Disposing of shared objects explicitly by user code, or internally by LightningChart, will very likely lead into crashing, black screen, or flickering problems.
Therefore: Sharing objects between other objects is forbidden.
Example 1 of wrong usage:
Code: Select all
AnnotationXY annotation1 = new Annotation();
chart.ViewXY.Annotations.Add(annotation1);
AnnotationXY annotation2 = new Annotation();
annotation2.Fill = annotation1.Fill;
chart.ViewXY.Annotations.Add(annotation2);
Correct way: Only copy properties if they are of ValueType (e.g. Integer, Double, Color)
Example 2 of wrong usage:
Code: Select all
SeriesEventMarker marker = new SeriesEventMarker();
chart.ViewXY.PointLineSeries[0].SeriesEventMarkers.Add(marker);
chart.ViewXY.PointLineSeries[1].SeriesEventMarkers.Add(marker);
Correct way: Create own marker for both series.