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

Mixed Font Style for Line Chart of X-Axis #581

Closed
osolano opened this issue Nov 30, 2015 · 1 comment
Closed

Mixed Font Style for Line Chart of X-Axis #581

osolano opened this issue Nov 30, 2015 · 1 comment

Comments

@osolano
Copy link

osolano commented Nov 30, 2015

I was wondering if the following was possible. Basically on the x-axis I have a set of dates with a string like
05 Sat
I wanted to do two things, one is to wrap the string so that the day number is on 1 line and weekday is on the next.
The next thing I wanted to do is see if I could make the first line a bigger font size then the second line. So basically 05 is larger than Sat

image

@liuxuan30
Copy link
Member

x axis support wrapping already, but I am not 100% sure it can achieve your goals, just give a try first.
checkout if below property can help you, or at least guide you how to customize your own:
also look at internal func drawLabels

    /// the position of the x-labels relative to the chart
    public var labelPosition = XAxisLabelPosition.Top

    /// if set to true, word wrapping the labels will be enabled.
    /// word wrapping is done using `(value width * labelRotatedWidth)`
    ///
    /// *Note: currently supports all charts except pie/radar/horizontal-bar*
    public var wordWrapEnabled = false

    /// - returns: true if word wrapping the labels is enabled
    public var isWordWrapEnabled: Bool { return wordWrapEnabled }

    /// the width for wrapping the labels, as percentage out of one value width.
    /// used only when isWordWrapEnabled = true.
    /// 
    /// **default**: 1.0
    public var wordWrapWidthPercent: CGFloat = 1.0

using two font seems not supported yet. Since this is a little customization-oriented. You could override some methods and add new font size property to do so.

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