TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
-
Eic
- Newbie
- Posts: 18
- Joined: Mon Apr 18, 2016 12:00 am
Post
by Eic » Thu Nov 03, 2016 1:47 pm
Hello,
I want to put the series bold flew into legend, but the Legend->Selected->Hover->Font->Style property is ignored.
Code: Select all
void __fastcall TscrTestGraphe::Button3Click(TObject *Sender)
{
TChart * Chart1 = new TChart(this);
Chart1->Parent = this;
Chart1->Align = alClient;
Chart1->Legend->Selected->Hover->Font->Style = Chart1->Legend->Selected->Hover->Font->Style << fsBold; //This code has no effect
Chart1->AddSeries(new TPointSeries(Chart1))->FillSampleValues();
}
How to do ?
Thank you
-
Eic
- Newbie
- Posts: 18
- Joined: Mon Apr 18, 2016 12:00 am
Post
by Eic » Mon Nov 07, 2016 7:36 am
Hello,
Thank you for your reply.
Pending publication of the correction, what alternative do you propose to bold the name of the hover series ?
-
Yeray
- Site Admin
- Posts: 9614
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
Post
by Yeray » Tue Nov 08, 2016 9:31 am
Hello,
You could do this trick at OnBeforeDraw event:
Code: Select all
procedure TForm1.ChartBeforeDraw(Sender: TObject);
var i: Integer;
begin
for i:=0 to Chart1.Legend.Items.Count-1 do
Chart1.Legend.Item[i].Font.Style:=Chart1.Legend.Item[i].Font.Style-[fsBold];
if Chart1.Legend.Selected.HoverIndex>-1 then
begin
Chart1.Legend.Items.Custom:=true;
Chart1.Legend.FontSeriesColor:=true;
Chart1.Legend.Item[Chart1.Legend.Selected.HoverIndex].Font.Style:=[fsBold];
end;
end;