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

setLabelsToSkip does not seem to function properly #594

Closed
Spoonrad opened this issue Dec 6, 2015 · 3 comments
Closed

setLabelsToSkip does not seem to function properly #594

Spoonrad opened this issue Dec 6, 2015 · 3 comments

Comments

@Spoonrad
Copy link

Spoonrad commented Dec 6, 2015

Hello and thank you for this amazing framework.

I'm trying to create a HorizontalBarChart and to make sure no X label gets skipped. I tried [xAxis setLabelsToSkip:0] with no success. I've also tried, as a test, to increase the number of labels to skip using [xAxis setLabelsToSkip:3], but it does not seem to do anything.

I would like to try changing the Modulus manually but the isAxisModulusCustom property is readonly.

Thank you.

@liuxuan30
Copy link
Member

  1. the bar's height height might smaller than the label's height, so it may be skipped, otherwise it will have overlay;
  2. you can change the source code or override calcModulus to meet your demand.

@Spoonrad
Copy link
Author

Spoonrad commented Dec 8, 2015

Hi,

  1. I don't understand what this means. Overlay? If I set labelsToSkip to 0, there is no overlay, a bunch of labels are skipped, that is all.
  2. I installed the framework via CocoaPods. If I change the source code, won't a pod update revert it back to your version of it when there's a new version of ios-charts? I tried subclassing HorizontalBarChartView (the bar chart View I'm using specifically), which already overrides calcModulus, but it gives me an error "Cannot subclass a class with objc_subclassing_restricted".

Thank you.

@liuxuan30
Copy link
Member

yes, if you are using pods, I guess you need to switch to the source files, make the customization, build the framework, and embed it. If you are supporting iOS 7, you can directly use the source files without having to embed the framework.
Currently ios-charts does not expose all the funcs to subclass or outside, that's why you have to modify it if you want to override them. If you think making some public or internal is good for a PR, just open one.

I'm trying to create a HorizontalBarChart and to make sure no X label gets skipped.
you are trying to display every x label for horz. bar chart, but there is one situation: many y values will lead the bar to be thinner, so the label's height will larger than the bar's height, so it's possible two x labels overlayed, right?

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