Page 1 of 1

Customize the font of each label axis

Posted: Fri Mar 19, 2010 3:53 pm
by 10547749
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;
}
}
}

Re: Customize the font of each label axis

Posted: Fri Mar 19, 2010 4:07 pm
by narcis
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.