Change style of hover series on legend

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Eic
Newbie
Newbie
Posts: 18
Joined: Mon Apr 18, 2016 12:00 am

Change style of hover series on legend

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

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Change style of hover series on legend

Post by Yeray » Fri Nov 04, 2016 12:42 pm

Hello,

I've reproduced it so I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1674
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Eic
Newbie
Newbie
Posts: 18
Joined: Mon Apr 18, 2016 12:00 am

Re: Change style of hover series on legend

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
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Change style of hover series on legend

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;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply