Not triggering didFinishTouchingChart()
After Touching the Chart and lift my finger the function didFinishTouchingChart() does not get fired. Is that right? I thought this method get fired after i'm finished touching the chart.
Hi @kevinlieser,
nope: the user will "finish" touching the chart only swiping left/right outside the chart. I honestly don't remember why I needed it working this way :sweat_smile:
Thanks @gpbl, Don't understand that. Why is the Method called like this? It should be called "didSwipeOutOfChart()" ;-) Okay, then i have to search another way to get the "touchUp" event. Any suggestions?
Anyway, thanks for this nice Library!
You are right, the name is wrong :smile: It shouldn't be hard to implement a didEndTouchingChart, let me try first.
Just replaced this in Chart.swift Line 721
override public func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) { handleTouchEvents(touches, event: event) }
with
override public func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) { handleTouchEvents(touches, event: event) drawHighlightLineFromLeftPosition(-1) delegate?.didFinishTouchingChart(self) }
In my optionion it does not matter wether the user swipes out left/right or lift the finger. ;-) BTW: The last Chart point is not touchable (or really really bad) when using Chart without margins to left/right.
Great thanks! I won't change however the behavior of that method for backward compatibility, so I'd prefer to add a new delegate method.
Yes, that would be nice and clean :-) I've edited my solution - forgot the drawHighlightLineFromLeftPosition(-1) to remove the line
Removing the highlight line may be a undesired behavior. Say, for example, the user wants to display something related to the highlighted value: removing the highlight line would hide the reference to the selected value. I think it would be better to add a removeHighlightLine method, or something like that.
Yes, for sure. But for my project this small workaround (untill you have an update) works ;-) On FingerUp all selected data get hidden and the "overall" data gets shown. Thats why i remove the line on TouchUp.
Short question - is there a way to round the Chart lines (like a wave instead of sharp edges)? Sorry for Offtopic and thanks!
Nope, not yet!
+1 for an ability to trigger didFinishTouchingChart whenever touchesEnd
@gpbl @bensaufley @kevinlieser Hi all,
I've submitted a pull request to fix this issue. Please see #62