SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

0
0

Hi guys,

Is it possible to capture the tap event when we tap on a point marker or a data point? I can see there’s a DataPointSelectionModifier for WPF, but there’s nothing for iOS. Our goal is to show a popup (tooltip) on the point marker when the user taps on it.

Thanks,
Lazar Nikolov

Version
2.2.2.854
  • Andrew
    Hi Lazar, Your trial has expired on 9th Nov hence our team is not answering. Have you purchased a SciChart license or continued to trial using an extension? If so let me know, we will be happy to help. Best regards, Andrew
  • Lazar Nikolov
    Yes we do have a license purchased, for both iOS and Android.
  • Andrew
    OK. If you could activate it – it will show as active in the forums. see http://www.scichart.com/licensing-scichart-ios
  • You must to post comments
0
0

For your question Lazar, the API you are looking for is the Hit-Test API.

This is common to all platforms of SciChart.

See SciChart iOS Hit-Test API docs.

// Swift 

 // where anyRenderableSeries is an instance of a SCIRenderableSeriesBase derived type
let hittestResult: SCIHitTestInfo = anyRenderableSeries.hitTestProvider().hitTestAt(x: 100, y: 100, radius: 10, onData: 
anyRenderableSeries.currentRenderPassData)

// Xamarin.IOS 

// where anyRenderableSeries is an instance of a SCIRenderableSeriesBase derived type
var hittestResult = anyRenderableSeries.HitTestProvider.HitTestAtX(100, 100, 10, anyRenderableSeries.CurrentRenderPassData);

The result of this operation is a HitTestInfo type. This contains info about the X,Y value under the mouse and whether it was clicked on a data-point

 typedef struct {
     BOOL match; // If TRUE then the hit-test was on a data-point 
     int index;
     double x; // The X-Coordinate tapped
     double y; // The Y-Coordinate tapped 
     SCIGenericType xValue; // The XValue under the point
     SCIGenericType yValue; // The YValue under the point
     SCIGenericType xValueInterpolated;
     SCIGenericType yValueInterpolated;
     SCIGenericType y2Value;
     SCIGenericType y2ValueInterpolated;
     SCIGenericType zValue;
     SCIGenericType zValueInterpolated;
     SCIGenericType openValue;
     SCIGenericType highValue;
     SCIGenericType lowValue;
     SCIGenericType closeValue;
     double radius;
 } SCIHitTestInfo;

Let me know if that helps.

We are missing a hit-test example for Xamarin.iOS but the equivalent one in Swift is here.

iOS Chart Hit Test API Example

Best regards
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.