-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
How to set LabelCount bigger than 25 in HorizatalBarView #2085
Comments
The labels are horribly optimized, The chart will try to redraw all your labels every time you call notifyDataChanged even if your labels are static, hence the 25 max limit. You should try to clone the repository and change the max value from 25 to whatever label count you need in AxisBase.swift. If your labels are static, i would recommend creating a view with the labels and overlay that view on the graph. |
label count is set to max 25 all the time, not just 3.x. |
Thanks for your answer @liuxuan30 @desnyki |
It is fixed to 25 (and 2) in
Unfortunately you cannot create an extension to override this behaviour as I wonder why the code does not use something like this to create a read-only variable:
Implementing a read-only variable using a |
As sometimes you really really want more than 25 labels, I would suggest to honor the force-Flag of the setter like so:
|
THX @mat2e
|
@Archerlly That´s even better! |
@Archerlly Have tried that as well but still the labels are not drawn properly in my case, its still skipping one label after drawing one..that is skipping label on odd positions.
// if labelCount > 25 {
|
@cuddle-sujeet Is there enough to draw the skipping label? |
@Archerlly by enough if u mean space then, there is enough space.. what I have noticed that for label count greater than 25 this drawing breaks else it draws perfectly fine as expected. I have also noticed that When I try to zoom in I can see the skipped labels and they are at the correct position. |
@cuddle-sujeet sorry, i don't very clear about your question. My solution is that:
Hope this can help u |
This change adds the ability to users to override the imposed limitation of at least 2 labels per axis and at most 25 labels per axis at their own risk. By default these customizable limits are hardcoded to the previous limits, at least 2 labels, at most 25.
…hartsOrg#2894) * Give the users customizable axis label limits (Fixes ChartsOrg#2085) This change adds the ability to users to override the imposed limitation of at least 2 labels per axis and at most 25 labels per axis at their own risk. By default these customizable limits are hardcoded to the previous limits, at least 2 labels, at most 25. * Type inference was enough to declare 'axisMinLabels' and 'axisMaxLabels' properties
* 'master' of https://github.com/danielgindi/Charts: (34 commits) Fixed X-Axis Labels Not Showing (ChartsOrg#3154) (ChartsOrg#3174) fix programatical unhighlighting for BarCharView (ChartsOrg#3159) Give the users customizable axis label limits (Fixes ChartsOrg#2085) (ChartsOrg#2894) bump pod version chart views now use open legend renderer property instead of internal one (ChartsOrg#3149) Fix axis label disappear when zooming in deep enough (ChartsOrg#3132) added DataApproximator+N extension (ChartsOrg#2848) Minor cleanup to Highlighter types (ChartsOrg#3003) Refactored ChartUtils method into CGPoint extension (ChartsOrg#3087) Update ViewPortHandler.swift (ChartsOrg#3143) add option to build demo projects unit tests on iOS (ChartsOrg#3121) Replaced relevant `ChartUtils` methods with `Double` extensions (ChartsOrg#2994) Update 4.0.0 with master (ChartsOrg#3135) Removed redundant ivars in BarLineChartViewBase (ChartsOrg#3043) fix ChartsOrg#1830. credit from ChartsOrg#2049 (ChartsOrg#2874) Makes ChartsDemo compiling again (ChartsOrg#3117) Fixed using wrong axis (Issue ChartsOrg#2257) Removed methods and properties deprecated in 1.0 (ChartsOrg#2996) for ChartsOrg#3061 revert animationUpdate() and animationEnd() not trigger crash if subclass does nothing The backing var is not necessary. (ChartsOrg#3000) ... # Conflicts: # Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift # Source/Charts/Highlight/BarHighlighter.swift # Source/Charts/Renderers/BarChartRenderer.swift
…hartsOrg#2894) * Give the users customizable axis label limits (Fixes ChartsOrg#2085) This change adds the ability to users to override the imposed limitation of at least 2 labels per axis and at most 25 labels per axis at their own risk. By default these customizable limits are hardcoded to the previous limits, at least 2 labels, at most 25. * Type inference was enough to declare 'axisMinLabels' and 'axisMaxLabels' properties
…hartsOrg#2894) * Give the users customizable axis label limits (Fixes ChartsOrg#2085) This change adds the ability to users to override the imposed limitation of at least 2 labels per axis and at most 25 labels per axis at their own risk. By default these customizable limits are hardcoded to the previous limits, at least 2 labels, at most 25. * Type inference was enough to declare 'axisMinLabels' and 'axisMaxLabels' properties
No description provided.
The text was updated successfully, but these errors were encountered: