I would like to change the color of labels on axis.
I tested two codes below, but both of these did not works.
1)
chart.GetAxis().GetLeft().GetLabels().GetFont().SetColor(RGB(255, 0, 0));
chart.GetAxis().GetLeft().GetLabels().Add(1, "test");
2)
unsigned long idx = chart.GetAxis().GetLeft().GetLabels().Add(1, "test");
chart.GetAxis().GetLeft().GetLabels().GetItem(idx).SetColor(RGB(255, 0, 0));
How can I do it?
Change color of axis label
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Change color of axis label
Hi corwl,
Code below works fine for me here. Which TeeChart version are you using?
If problem persists can you please attach a simple example project we can run "as-is" to reproduce the problem here?
Thanks in advance.
Code below works fine for me here. Which TeeChart version are you using?
Code: Select all
m_Chart1.GetAxis().GetLeft().GetLabels().GetFont().SetColor(RGB(255, 0, 0));
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Change color of axis label
Thank you for your reply.
Please check the attached project.
project was produced with VC2003 and TChart version is V8.0 1.
Please check the attached project.
project was produced with VC2003 and TChart version is V8.0 1.
- Attachments
-
- tchartTest.zip
- (106.31 KiB) Downloaded 699 times
Re: Change color of axis label
Hi corwl,
In v8, if you are using custom labels, you have to change the label font:
In v2010 changing the axis labels font also applies to the custom labels.
In v8, if you are using custom labels, you have to change the label font:
Code: Select all
m_chart.GetAxis().GetLeft().GetLabels().GetItem(0).GetFont().SetColor(RGB(255, 0, 0));
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Change color of axis label
Yes it works!
I really appreciate you Yeray.
I really appreciate you Yeray.