Pre loader

RolloverModifier Sensitivity in a line set with data at only one xAxis point

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

0
0

In my implementation I have the xAxis using a DateAxis in the dataset I am using there is only one data point.

The RolloverModifier is very sensitive it is very hard to highlight that one point.

RolloverModifier rolloverModifier = new VitalChartRolloverModifier();
rolloverModifier.setSourceMode(SourceMode.AllVisibleSeries);
rolloverModifier.setDrawVerticalLine(true);
rolloverModifier.setShowTooltip(true);
rolloverModifier.setShowAxisLabels(false);
rolloverModifier.setIsEnabled(true);
rolloverModifier.setUseInterpolation(false);

Is there a way of making it less sensitive?

Version
Api 27
  • You must to post comments
0
0

Hi,

I have implemented the code but there is a problem. In more points are selected then should be and the rollover line does not work properly with a full set of lineSets.

Please see the attached video at the link. This shows the problem in more detail.

  • Andrew Burnett-Thompson
    Hi Simon, thank you for the video. This is the kind of thing ideally we need a code sample or access to code to debug this and suggest improvements. This also isn’t a service we typically provide to SciChart users who don’t have a support subscription. What I suggest you do is send a code sample to support [at] scichart [dot] com and I’ll ask the team to have a quick look. If it’s something they can find a workaround quickly then I’ll sanction it. If it looks more in-depth (customization required) we might need to talk about support subscriptions.
  • Simon Barnes
    Hi Andrew, we have gone ahead and purchased a SciChart Pro LifeTime License. How should we progress with this query?
  • You must to post comments
0
0

Hi Simon,

Thanks for providing video – it was really helpful. To implement desired behavior which will prevent showing RolloverModifier outside line bounds you can create next custom lines series:

class CustomLineSeries extends FastLineRenderableSeries {

    public CustomLineSeries() {
        super(new LineRenderPassData(), new CompositeHitProvider(new PointMarkerHitProvider(), new CustomLineHitProvider()), new NearestXyPointProvider());
    }

    private static class CustomLineHitProvider extends LineHitProvider {
        @Override
        public void updateVertical(HitTestInfo hitTestInfo) {
            // set flags to true so RolloverModifier will always display tooltip at nearest data point
            hitTestInfo.isHit = hitTestInfo.isWithinDataBounds = true; 
        }
    }
}

and then use it instead of regular line series:

    final FastLineRenderableSeries rSeries = new CustomLineSeries();
    rSeries.setDataSeries(dataSeries);
    rSeries.setStrokeStyle(new SolidPenStyle(0xFF279B27, true, 1f, null));

Is this suitable for your needs?

Best regards,
Yura.

  • You must to post comments
0
0

Hi Yura,

Yes I see my language there is a little awkward.

What I mean is that it is very difficult to get the RolloverModifier to highlight a datapoint in a single datapoint set series with the ootb implementation.

However you reply does point to a way in modifying the ootb behaviour.

To help with your understanding of what we wish to achieve I have attached a link to a shared folder containing a screen movie of the app with audio.

  • You must to post comments
0
0

Hi Simon,

Thanks for your question.

I’m not 100% understand what do you mean by making RolloverModifier ‘less sensitive’ but unfortunately we don’t provide such behavior out of the box because it’s not how it works – by default this modifier just uses our HitTest API ( in case of RolloverModifier it uses hitTestVertical ) to get and display information about point on the screen and it’s responsibility of renderable series to provide this information. So if you want to override this behavior then you’ll need to create a custom renderable series with custom INearestPointProvider implementation which is responsible for searching nearest data point on screen ( for RolloverModifier you’ll need to override setNearestHorizontalPointResult method and provide desired point index ).

Unfortunately it’s pretty advanced topic and we don’t provide a documentation which covers this case for now so unless you provide more detailed explanation of what kind of behavior you’re trying to achieve and what type of series you use then I won’t be able to help you.

Best regards,
Yura

  • You must to post comments
Showing 4 results
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