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

ChartData ValueTextColor can not achieve a variety of colors #3669

Closed
AflyingApple opened this issue Sep 29, 2018 · 1 comment
Closed

ChartData ValueTextColor can not achieve a variety of colors #3669

AflyingApple opened this issue Sep 29, 2018 · 1 comment

Comments

@AflyingApple
Copy link

What did you expect to happen?

I want to set many colors for labels.

What happened instead?

But no method is found, but the Android framework(MPAndroidChart) can be implemented.

Charts Environment

**Charts version Number:3.2.0
**Xcode version:10.0
**Swift version:4.2
**Platform(s) running Charts:iOS
**macOS version running Xcode:10.14

Demo Project

a022b921-32bc-4b63-ab2d-a210178b8be3

3f491ea6-bf8c-493f-878e-81a8ace0e082

@liuxuan30
Copy link
Member

    /// - returns: The color at the specified index that is used for drawing the values inside the chart. Uses modulus internally.
    open func valueTextColorAt(_ index: Int) -> NSUIColor
    {
        var index = index
        if index < 0
        {
            index = 0
        }
        return valueColors[index % valueColors.count]
    }

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