Hi Ric,
We have already fixed all issues based on disposed object in
our latest version. Could you please update the SfChart version to latest
(16.1.0.37) and check whether the issue reproduced in your application?
You can find the different options to get the latest version
of SfChart component from here.
https://help.syncfusion.com/xamarin/introduction/download-and-installation
The latest version of SfChart component is available in
official nuget server as well.
https://www.nuget.org/packages/Syncfusion.Xamarin.SfChart/
Please let us know if you are still facing any issue in
this.
Regards,
Muneesh Kumar G.
|
public class CustomColumnSeries : ColumnSeries
{
protected override PointF GetGradientStartPoint(ChartSegment segment)
{
if (segment == null) return new PointF(0, 0);
var segmentBounds = (System.Drawing.RectangleF)segment.GetType().
GetProperty("GradientBounds", System.Reflection.BindingFlags.NonPublic |
System.Reflection.BindingFlags.Instance).GetValue(segment);
var gradientStartPoint = ColorModel.CustomGradientColors[Segments.IndexOf(segment) % ColorModel.CustomGradientColors.Count].StartPoint;
Single startX = Single.IsNaN(gradientStartPoint.X) ? 0.5f : gradientStartPoint.X;
Single startY = Single.IsNaN(gradientStartPoint.Y) ? 1 : gradientStartPoint.Y;
return new PointF(segmentBounds.Left + segmentBounds.Width * startX, segmentBounds.Top + segmentBounds.Height * startY);
}
protected override PointF GetGradientEndPoint(ChartSegment segment)
{
if (segment == null) return new PointF(0, 0);
var segmentBounds = (System.Drawing.RectangleF)segment.GetType().
GetProperty("GradientBounds", System.Reflection.BindingFlags.NonPublic |
System.Reflection.BindingFlags.Instance).GetValue(segment);
var gradientEndPoint = ColorModel.CustomGradientColors[Segments.IndexOf(segment) % ColorModel.CustomGradientColors.Count].EndPoint;
Single endX = Single.IsNaN(gradientEndPoint.X) ? 0.5f : gradientEndPoint.X;
Single endY = Single.IsNaN(gradientEndPoint.Y) ? 0 : gradientEndPoint.Y;
return new PointF(segmentBounds.Left + segmentBounds.Width * endX, segmentBounds.Top + segmentBounds.Height * endY);
}
}
|