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

please tell me how do i handling these problems,thanks! #1373

Closed
yushan023 opened this issue Aug 30, 2016 · 10 comments
Closed

please tell me how do i handling these problems,thanks! #1373

yushan023 opened this issue Aug 30, 2016 · 10 comments

Comments

@yushan023
Copy link

how do i custom value different colors in LineChart?
and how do i custom unit in chartView in x-axis or y-axis? for example UI
image

@liuxuan30
Copy link
Member

Please check out ChartsDemo for the unit, seems a formatter is enough.
For the color, if you are talking about highlight, it's highlightColor. If you only want specific color is different, check out circleColors

@yushan023
Copy link
Author

For the color,it's not highlightColor. It's normalColor, it can show different color on chartView in the same time.

@liuxuan30
Copy link
Member

well to me the last circle is highlighted. anyway, circleColors is the answer

@yushan023
Copy link
Author

thanks a lot. I find the circleColors is Array.But the problem is the last circle must be shining.
i won't set hightlighted.can you teach me?

ed0ac298-b472-4042-b94e-65da48a19295

@liuxuan30
Copy link
Member

liuxuan30 commented Sep 8, 2016

"circleColors is array" then why don't you set the last color as orange.. am I missing anything or you don't think about it

@yushan023
Copy link
Author

First, I didn't find circleColors before this property.Thanks you for helping me before.
Not the last one is yellow.Sometimes it is in the middle.This is no problem.

But I have a problem not solved.
"circleHoleColor" can only be set once.Once set this property, the curve on the other round also become this attribute.
setting "circleHoleColor" Which means that light.I only want a yellow light.And you said the highlightColor of is not what I want.

@liuxuan30
Copy link
Member

    /// The radius of the drawn circles.
    var circleRadius: CGFloat { get set }

    /// The hole radius of the drawn circles.
    var circleHoleRadius: CGFloat { get set }

    var circleColors: [NSUIColor] { get set }

    /// - returns: the color at the given index of the DataSet's circle-color array.
    /// Performs a IndexOutOfBounds check by modulus.
    func getCircleColor(_ index: Int) -> NSUIColor?

    /// Sets the one and ONLY color that should be used for this DataSet.
    /// Internally, this recreates the colors array and adds the specified color.
    func setCircleColor(_ color: NSUIColor)

    /// Resets the circle-colors array and creates a new one
    func resetCircleColors(_ index: Int)

    /// If true, drawing circles is enabled
    var drawCirclesEnabled: Bool { get set }

    /// The color of the inner circle (the circle-hole).
    var circleHoleColor: NSUIColor? { get set }

    /// True if drawing circles for this DataSet is enabled, false if not
    var drawCircleHoleEnabled: Bool { get set }

Which version are you using? As you see, lots of properties to use, so maybe try them to figure out what best for you

@yushan023
Copy link
Author

yushan023 commented Sep 9, 2016

I want to achieve this.
805e1c25-928f-49c2-b071-cc7850419153
If is yellow must use "circleHoleColor" this property.But once set this property, the red will also corresponding change.
I don't want to let the red also have become "circleHoleColor" this property, I just want to set this property "circleHoleColor" yellow.
At present, I can only be implemented as such, the following figure.
abcd007d-b9a1-4fbb-bc37-5243aef51f3e
Once use "circleHoleColor" this property like this.
0ad40cad-6d50-4d88-ad98-dd4961d02287

@liuxuan30
Copy link
Member

Ah I see. circleHoleColor is not array, it's just the hole color. Guess you have to override drawCircles to get what you want.

@yushan023
Copy link
Author

yushan023 commented Sep 9, 2016

I think override "drawCircles" this method also can not solve Because the yellow is not necessarily at the end.Perhaps can use pictures instead of? To use a different picture

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