Hi,
I’m experiencing a glitch using polar charts with small values.
In the attached example, I tried to create an arc starting at 0.0004, the problem is that up to a certain level of zoom, it works fine, then it start creating corrupted shapes. You can see all stages of the glitch in the picture.
Is this related to small values? I really have to work with small numbers, any workaround?
My client is using an older version, but I tried with mine, 7.0 and I get the same problem.
Thanks
- Alessio Diana asked 7 months ago
-
Hi Alessio, Thank you for reporting this. Could you please also share the steps to reproduce this issue in our Polar Chart example? Thanks in advance, Lex SciChart Technical Support Engineer
- You must login to post comments
I thought we were using a standard feature, but we have custom code, I think I fixed the error, but my guess is that there is something wrong in the library.
This is what I have:
Derived from CustomRenderableSeries, override Draw()
VM.RadiusStart = 0.0004
VM.RadiusEnd = 30.0;
ITransformationStrategy transformatinoStrategy = renderPassData.TransformationStrategy;
var yCalc = renderPassData.YCoordinateCalculator;
var xCalc = renderPassData.XCoordinateCalculator;
Point outerStart = transformatinoStrategy.ReverseTransform(new Point(xCalc.GetCoordinate(VM.AngleStart), yCalc.GetCoordinate(VM.RadiusStart)));
Point outerEnd = transformatinoStrategy.ReverseTransform(new Point(xCalc.GetCoordinate(VM.AngleEnd), yCalc.GetCoordinate(VM.RadiusStart)));
Point innerStart = transformatinoStrategy.ReverseTransform(new Point(xCalc.GetCoordinate(VM.AngleStart), Math.Min(2000.0, yCalc.GetCoordinate(VM.RadiusEnd)) ));
Point innerEnd = transformatinoStrategy.ReverseTransform(new Point(xCalc.GetCoordinate(VM.AngleEnd), Math.Min(2000.0, yCalc.GetCoordinate(VM.RadiusEnd)) ));
var OuterPoints = CreateArcFromAngle(renderContext.ViewportSize.Width / 2, renderContext.ViewportSize.Height / 2, outerStart.X, outerStart.Y, arcAngle, 1000);
var InnerPoints = CreateArcFromAngle(renderContext.ViewportSize.Width / 2, renderContext.ViewportSize.Height / 2, innerStart.X, innerStart.Y, arcAngle, 1000);
If I remove the Math.Min and I zoom-in to very small numbers, yCalc.GetCoordinate(VM.RadiusEnd) returns some crazy big number.
In my case this simple cap solves the issue and is good enough for me, hope this helps you find a potential bug.
Thanks
- Alessio Diana answered 7 months ago
- last edited 7 months ago
-
Hi Alessio, Thanks for your reply. I’m glad you’ve found a solution! Unfortunately, it’s not enough information to determine the cause of this issue on our side. Could you please prepare a small sample project reproducing this ar provide us with steps to reproduce the mentioned issue in one of our examples from the WPF Examples suite? Thanks in advance
- You must login to post comments
Please login first to submit.