Customize the font of each label axis

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Beto
Newbie
Newbie
Posts: 4
Joined: Thu Dec 13, 2007 12:00 am

Customize the font of each label axis

Post by Beto » Fri Mar 19, 2010 3:53 pm

I'm developing with C + + Builder 2006, TeeChart Pro v8.06.60902 Win32


I am using a TChart component with a TBarSeries, and before upgrading to new version could customize each label of the axis changing font properties in the event OnGetAxisLabel of TChart, and after the upgrade does not work.

Before it was as if every label had its own font, and now it seems a single source for all the labels of an axis.

There is a solution to this effect?



void __fastcall TMyForm::ChartGetAxisLabel(TChartAxis *Sender, TChartSeries *, int ValueIndex, AnsiString &LabelText)
{
if( Sender == Chart->BottomAxis )
{
if( LabelText == "Winner" )
{
Chart->BottomAxis->LabelsFont->Size = 12;
Chart->BottomAxis->LabelsFont->Style = TFontStyles() << fsBold;
Chart->BottomAxis->LabelsFont->Color = clRed;
}
else
{
Chart->BottomAxis->LabelsFont->Size = 8;
Chart->BottomAxis->LabelsFont->Style = TFontStyles();
Chart->BottomAxis->LabelsFont->Color = clBlue;
}
}
}

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Customize the font of each label axis

Post by Narcís » Fri Mar 19, 2010 4:07 pm

Hi Beto,

The only solution I can think of for this is using custom axis labels as shown at the All Features\Welcome!\Axes\Labels\Custom Labels example in the new features demo available at TeeChart's program group.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply