Pre loader

VerticalSliceModifier ignores UseInterpolation=False

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

Answered
0
0

Hi together,

my XValues = e.g [1,2,3,4,5]

im currently using a VerticalSliceModifier with UseInterpolation set to false but the VerticalLine Label still displays values like 1.22.
When using a rollover modifier with UseInterpolation set to false i only get the expected dataValue e.g 1.

Why is the verticalSlice modifier ignoring this and how do i fix this.

ps: I´ve attached an screenshot from an sample project.

Thank you in advance.

Best regards,
Armin

Version
8
Images
  • Lex
    Hi Armin, Thanks for your inquiry. Please accept my apologies for the late response. I am going to discuss this with our team and will get back to you as soon as I have an update. Kind regards, Lex, SciChart Technical Support Engineer
  • Armin Wild
    Hi Lex, i accepted your answer but it only works on double values how about Datetime objects too.
  • You must to post comments
Good Answer
0
0

Hi Armin,

Hope you are doing well.
We discussed your inquiry.
VerticalSliceModifier doesn’t support moving Vertical Lines between data points because it uses VerticalLineAnnotations under the hood. The Modifier itself just adds these annotations to the SciChartSurface.

However, there is a workaround.
You can create a custom VerticalLineAnnotation and override the FromCoordinate method there.
You just need to return an appropriate value where the Annotation should be placed.

For example, the following code sample allows to drag annotation between points that are divisible by 0.2:

    public class CustomHorizontalLine : HorizontalLineAnnotation
{
    protected override IComparable FromCoordinate(double coord, IAxis axis)
    {
        if (axis.IsXAxis)
        {
            return base.FromCoordinate(coord, axis);
        }
        else
        {
            var data = (double) base.FromCoordinate(coord, axis);

            data -= data%0.2;
            return data;
        }
    }
}

Hope this helps.

Kind regards,
Lex

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.