Customize the font of each label axis
Posted: 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;
}
}
}
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;
}
}
}