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

how to limit the YAxis Label's width? #588

Closed
hengchengfei opened this issue Dec 3, 2015 · 3 comments
Closed

how to limit the YAxis Label's width? #588

hengchengfei opened this issue Dec 3, 2015 · 3 comments

Comments

@hengchengfei
Copy link

I want to limit the label's width.

For example:
leftAxis.labelWidth = 20

@liuxuan30
Copy link
Member

YAxis has two property to define it (used by requiredSize()):

    /// **default**: 0.0
    public var minWidth = CGFloat(0)

    /// the maximum width that the axis can take.
    /// use zero for disabling the maximum
    /// 
    /// **default**: 0.0 (no maximum specified)
    public var maxWidth = CGFloat(0)

xAxis has below:

    /// width of the x-axis labels in pixels - this is automatically calculated by the computeAxis() methods in the renderers
    public var labelWidth = CGFloat(1.0)

    /// height of the x-axis labels in pixels - this is automatically calculated by the computeAxis() methods in the renderers
    public var labelHeight = CGFloat(1.0)

    /// width of the (rotated) x-axis labels in pixels - this is automatically calculated by the computeAxis() methods in the renderers
    public var labelRotatedWidth = CGFloat(1.0)

@hengchengfei
Copy link
Author

Thank you

@MelkonYoussif
Copy link

This does not work me.. the labels are still getting large. For example when I set xAxis?.labelWdith = 1.0, I still get a very large label. what can I do to still achieve this?

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