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

Not all labels shown on horizontal bar chart with large datasets #2339

Closed
tobsterH opened this issue Apr 8, 2017 · 3 comments
Closed

Not all labels shown on horizontal bar chart with large datasets #2339

tobsterH opened this issue Apr 8, 2017 · 3 comments

Comments

@tobsterH
Copy link

tobsterH commented Apr 8, 2017

Hi,

I have a horizontal bar chart that works perfectly fine for up to 37 bars.
Starting with 38 bars, not all labels are shown on the xAxis anymore.

The code is always the same and I'm setting labelCount to the number of bars I want to show:

xAxis.labelCount = numberEntries

Is there a maximum number of bars that can be shown? Or any other ideas?

Many thanks!

@liuxuan30
Copy link
Member

liuxuan30 commented Apr 10, 2017

there is no limit for bars. But there are limits for labels:

    /// the number of label entries the axis should have
    /// max = 25,
    /// min = 2,
    /// default = 6,
    /// be aware that this number is not fixed and can only be approximated

in open var labelCount: Int

However, I need to know what you mean by not all labels are shown on the xAxis anymore. Because you said you have 37 bars are fine but 38 is not. Which is confusing as the max label count is 25 already, you can't see 37 labels.. We need to know if it's expected, or bug.

Usually, it will not show every label, it will do some calculation to make sure the labels are not overlapped.

@hernanarber
Copy link

hernanarber commented May 3, 2017

Hi:

I Solved this By Commenting out the Hardcoded limit for the LabelCount within AxisBase.swift, Like this:


    open var labelCount: Int
    {
        get
        {
            return _labelCount
        }
        set
        {
            _labelCount = newValue
            // WHY?
            // This limits the Amount of Labels We can Display: (Removing)
//            
//            if _labelCount > 25
//            {
//                _labelCount = 25
//            }
//            if _labelCount < 2
//            {
//                _labelCount = 2
//            }
//            
            forceLabelsEnabled = false
        }
    }

I Hope this Helps :-)

@HPRaval
Copy link

HPRaval commented May 26, 2017

worked for me too....thnx...this should be changed

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

4 participants