Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gesture conflict when lineChartView in tableView #984

Closed
GC-yuzhang opened this issue Apr 28, 2016 · 7 comments
Closed

gesture conflict when lineChartView in tableView #984

GC-yuzhang opened this issue Apr 28, 2016 · 7 comments

Comments

@GC-yuzhang
Copy link

GC-yuzhang commented Apr 28, 2016

i have a tableView
each cell has a lineCharView
after lineChartView zoom in and horizontal scroll,
tableView can not vertical scroll when tap on linechartView
how can i fix it? thanks 100 times.

@liuxuan30
Copy link
Member

liuxuan30 commented Apr 29, 2016

I remember there is some code for it.

check gestureRecognizer(gestureRecognizer: NSUIGestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer otherGestureRecognizer: NSUIGestureRecognizer), and panGestureRecognized func
but I don't remember is there any property for this. please take a look at the code

@danielgindi
Copy link
Collaborator

The code automatically handles cases where there are zoom-pan on the chart. When you reach the end of the chart - it will stop panning and enable the scrolling on the parent.

If you want to be able to scroll while panning the chart, then do what @liuxuan30 suggested. There are also other discussions in issues, so you can search for it and gain some insights.

@GC-yuzhang
Copy link
Author

3q for all

@inix
Copy link

inix commented Dec 1, 2016

@alanz1982
hi, I have similar scenario with you,that,I disable Y axis scale,but I can not scroll vertically tableview in the chart.
I just do a simple hack,that if chart disable Y axis scale,enable UITableView vertically scrolling.

		if !self.isScaleYEnabled {
			_outerScrollView?.nsuiIsScrollEnabled = true
		} else {
			_outerScrollView?.nsuiIsScrollEnabled = false
		}

in func @objc fileprivate func panGestureRecognized(_ recognizer: NSUIPanGestureRecognizer)
of BarLineChartViewBase.swift file

diff:

@@ -688,7 +688,11 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD
                     if _outerScrollView !== nil
                     {
                         // Prevent the parent scroll view from scrolling
-                        _outerScrollView?.nsuiIsScrollEnabled = false
+                                               if !self.isScaleYEnabled {
+                                                       _outerScrollView?.nsuiIsScrollEnabled = true
+                                               } else {
+                                                       _outerScrollView?.nsuiIsScrollEnabled = false
+                                               }
                     }
                 }
                 

@GC-yuzhang
Copy link
Author

GC-yuzhang commented Dec 12, 2016 via email

@shanyulaile
Copy link

I tried it your way, but the tableview is still not sliding vertically, and I'm adding the following code to the BarlinechartViewBase

@@ -688,7 +688,11 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD if _outerScrollView !== nil { // Prevent the parent scroll view from scrolling - _outerScrollView?.nsuiIsScrollEnabled = false + if !self.isScaleYEnabled { + _outerScrollView?.nsuiIsScrollEnabled = true + } else { + _outerScrollView?.nsuiIsScrollEnabled = false + } } }

@pratik-jaiswal
Copy link

pratik-jaiswal commented Jan 31, 2020

Hi, I tried with your hack but its not working. Do you have any other way of achieveing that?
Or is there any other way to do this? @liuxuan30 @danielgindi @inix

if _outerScrollView !== nil
{
// Prevent the parent scroll view from scrolling
_outerScrollView?.nsuiIsScrollEnabled = false
if !self.isScaleYEnabled {
_outerScrollView?.nsuiIsScrollEnabled = true
} else {
_outerScrollView?.nsuiIsScrollEnabled = false
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants