Pre loader

Axis Value For Touch 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

Answered
1
0

Hi,

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.

Thanks,
Irmak

Version
1.2.0.8
  • You must to post comments
Best Answer
2
0

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
    }
}

And

// 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
Andrii
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.

Try SciChart Today

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

Start TrialCase Studies