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
- Irmak Can Ozsut asked 7 years ago
- last edited 7 years ago
- You must login to post comments
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
- Andrii Poliuk answered 7 years ago
-
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
-
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
-
Sure, thank you.
- You must login to post comments
Please login first to submit.