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

Access level of ChartViewBase's API #4243

Closed
1 task done
ChaoLiao opened this issue Dec 12, 2019 · 1 comment
Closed
1 task done

Access level of ChartViewBase's API #4243

ChaoLiao opened this issue Dec 12, 2019 · 1 comment

Comments

@ChaoLiao
Copy link

What did you do?

I needed to display 2 data sets in the marker (tooltip) of LineCharView. So I created a subclass of LineChartView and needed to override drawMarkers(context: CGContext) to display 2 data sets. Since drawMarkers(context: CGContext) is internal in ChartViewBase and CombinedChartView and therefore cannot be overridden, I changed the source code to make it open.

What did you expect to happen?

Changing the source code works, but it's not ideal. It makes updating the pod problematic. Also, my Android partner told me the same method is open in the Android library.

What happened instead?

Changing the source code works, but when we updated the pod version it broke.

Charts Environment

Charts version/Branch/Commit Number: 3.4.0
Xcode version: 10.3/11
Swift version: 5
Platform(s) running Charts: iPhone
macOS version running Xcode:

Demo Project

Screen Shot 2019-11-05 at 11 55 23 AM

@liuxuan30
Copy link
Member

well... it's hard to tell if we should to mark it open or internal... as you can see drawMarkers IMP is not ideal to mark it open. too much details for a public method.
normally, I'd encourage if you need heavy customizations, you should grab the source code. Pod is just for grab-and-use or light weight overriding.

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

2 participants