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

Highlight a label in xAxis #530

Closed
mats-claassen opened this issue Nov 3, 2015 · 5 comments
Closed

Highlight a label in xAxis #530

mats-claassen opened this issue Nov 3, 2015 · 5 comments

Comments

@mats-claassen
Copy link

Hi, I am trying to draw a line chart where one entry is highlighted. I can get the circle to be different to the others but I did not find a way to have different fonts and colors for the labels in the xAxis. I mean having all labels with one font but the selected label with another font.
Is there a way to do this? I tried using attributed strings but that did not work either.

@liuxuan30
Copy link
Member

You can trigger another drawLabels, get which label you need to highlight and feed your own colors, fonts etc. when highlighting. It is not designed to do so for now.

@jibax
Copy link

jibax commented Nov 20, 2015

Hi @mats-claassen Did you managed the set a different font for the labels? I have the same problem

@liuxuan30
Copy link
Member

so some details:
xAxis has font and color property called labelFont and labelTextColor you can set it from there.
If you want to set different font, then you may have to customize yourself - take a look at
internal func drawLabels(context context: CGContext, pos: CGFloat, anchor: CGPoint), and override it with your own implementation.

@thang2410199
Copy link

Hi @mats-claassen , how do you custom the circle of the highlighted entry ? Thank you.

@mats-claassen
Copy link
Author

@thang2410199 I ended up using my fork which I changed to fit my particular needs. Not sure it will be useful for you. It is almost 3 years old as well.

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

4 participants