Pre loader

Polar zoom glitch

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

1
0

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

Version
4.2.2 / 7.0
Images
  • Lex
    • Lex
    • 2 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 to post comments
1
0

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

  • Lex
    • Lex
    • 2 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 to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies