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



Is there any possible way to get axis value for a point in chart view? I use pan gesture to get the touch location and convert it to its context point but cannot find the value for that CGPoint.


  • You must to post comments
Best Answer

Good day

Need more information to be more specific
But here is example how to write to console X and Y data values at pan gesture location on surface:

//create custom modifier
class CoordToConsole : SCIGestureModifier {
    override func onPanGesture(gesture: UIPanGestureRecognizer!, at view: UIView!) -> Bool {
        let xCalc : SCICoordinateCalculator = self.xAxis().getCurrentCoordinateCalculator()
        let yCalc : SCICoordinateCalculator = self.yAxis().getCurrentCoordinateCalculator()

        let location : CGPoint = gesture.locationInView(view)

        NSLog( "X: %.2f Y: %.2f",
               xCalc.getDataValueFrom( Double(location.x) ),
               yCalc.getDataValueFrom( Double(location.y) ))

        return true


// create instance and attach it to surface
    let coordLog = CoordToConsole()
    let groupModifier = SCIModifierGroup(childModifiers: [otherModifier1, otherModifier2, coordLog])
    chartSurface.chartModifier = groupModifier // where chartSurface is SCIChartSurface

Best regards
SciChart iOS developer

  • Irmak Can Ozsut
    Hi Andrii, Thank you for your quick reply. That’s what I was looking for! But I have one more issue regarding to SCIAxisMarkerAnnotation that I could not find. Can I customise the look of it or should I implement my own axis marker? And lastly, can I add another pan gesture to annotation pin to change the axis annotation location by the user? Thanks, Irmak
  • Andrew Burnett-Thompson
    Hi Irmak – it’s worth asking a separate question for each of these, as the Q&A format of the forum is not suited to long conversations. Can you do this please? I will also ask the team for their input. Best regards, Andrew
  • Irmak Can Ozsut
    Sure, thank you.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.