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

The delegate method is not getting called #695

Closed
wganeshb opened this issue Jan 21, 2016 · 3 comments
Closed

The delegate method is not getting called #695

wganeshb opened this issue Jan 21, 2016 · 3 comments

Comments

@wganeshb
Copy link

I am integrating the pie chart. I want to find the selected index of the Piechart. But the control doesn't go inside the delegate method.

I checked all the possible location for anything missed. But could not find. It took my 2 days. Anybody out there have any suggestions.

Please check the screenshots attached. Following is description for the screen shots.

  1. The view controller in storyboard is assigned with Class name "PieChartViewController".
  2. The view on PieChartViewController is attached with PieChartView and and Charts module.
  3. The delegate protocols is followed and delegate for pie charts is declared.
  4. The delegate methods for the pie charts are implemented.

screen shot 2016-01-21 at 4 27 13 pm

screen shot 2016-01-21 at 4 14 13 pm

screen shot 2016-01-21 at 4 15 06 pm

screen shot 2016-01-21 at 4 15 28 pm

@liuxuan30
Copy link
Member

Well, ChartsDemo's pie chart is able to trigger the delegate, you can start from there. From your screenshot I can say nothing but debug more / add more break points.
Some hints:

  1. whether your pie chart view is initialized correctly and you can see the pie chart
  2. whether you enable user interaction (by default true)
  3. whether pie chart view has detect your gesture (simply add bp inside @objc private func tapGestureRecognized in PieRadarChartViewBase)

item 3 is the key to call delegate (tapGestureRecognized -> highlightValue -> chartValueSelected)

@jinrui1130
Copy link

I have the same issue.
My chart is rendered correctly and it has user interactions like tap and pinch zoom. Also chart is able to detect my tap gesture. But somehow

func chartValueSelected(chartView: ChartViewBase, entry: ChartDataEntry, dataSetIndex: Int, highlight: Highlight){
        print("###################")
    }

cannot be called

really need some help here

@jinrui1130
Copy link

Also, what do you mean by adding bp

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

3 participants