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

Can i customize the X axis text a different color? #1810

Closed
yushan023 opened this issue Nov 9, 2016 · 5 comments
Closed

Can i customize the X axis text a different color? #1810

yushan023 opened this issue Nov 9, 2016 · 5 comments

Comments

@yushan023
Copy link

Can i customize the X axis text a different color?
For example:
image

image
image
I only did this custom text followed the demo, I don't know how to set up a different color

@lightwindy
Copy link

你应该用 "xAxis.labelTextColor = CQTextLightColor; "去改变label的颜色。
You should use "xAxis.labelTextColor = CQTextLightColor;" to change the label color.

@yushan023
Copy link
Author

... 你看懂我的表达了吗?我不是不知道设置颜色的属性。我的问题是自定义,label设置不同的颜色。Did you read my expression?Not that I don't know set color properties.My problem is the custom, the label set a different color.

@lightwindy
Copy link

现在明白你的意思了,不同的xAxis值对应不同颜色的label. 应该是用valueFormatter, 但我不知道怎么弄。
Now I understand your meaning. Different xAxis value has different color. You should use valueFormatter do it. but I don't know how to do it.

@yushan023
Copy link
Author

valueFormatter 只是让用户定义值而已

@liuxuan30
Copy link
Member

liuxuan30 commented Nov 11, 2016

open class AxisBase: ComponentBase
{
    open var labelFont = NSUIFont.systemFont(ofSize: 10.0)
    open var labelTextColor = NSUIColor.black

If you want show multiple colors, you should override x axis renderer drawLabels() and add labelTextColors property.

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