Hi,
I would like to enable/disable the hovering for the whole TLineSeries manually, for example enable it in the OnClick event of a series in order to highlight some series - is there a way to do that ?
Best regards,
Klaus
control TChartSeries hover effect manually
Re: control TChartSeries hover effect manually
Hi Klaus,
Do you mean doing something like this?
Do you mean doing something like this?
Code: Select all
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.View3D:=false;
with Chart1.AddSeries(TLineSeries) do
begin
FillSampleValues();
OnClick:=SeriesClick;
end;
Chart1.Hover.Visible:=false;
end;
procedure TForm1.SeriesClick(Sender:TChartSeries; ValueIndex:Integer; Button:TMouseButton; Shift: TShiftState;
X, Y: Integer);
begin
if Sender.Pen.Width=1 then
Sender.Pen.Width:=3
else
Sender.Pen.Width:=1;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: control TChartSeries hover effect manually
Dear Yeray,
thanks for the suggestion to change the pen width in the onclick event ! This is an option but does not a have similar look when compared with hovering. Is there a way to make it look like the hover effect ? - Can I turn on/off the hovering manually at runtime for the whole series - i.e. show the hover effect for all connecing lines, and not only the selected element like its standard behaviour when Chart1.Hover.Visible:=TRUE ?
Best regards,
Klaus
thanks for the suggestion to change the pen width in the onclick event ! This is an option but does not a have similar look when compared with hovering. Is there a way to make it look like the hover effect ? - Can I turn on/off the hovering manually at runtime for the whole series - i.e. show the hover effect for all connecing lines, and not only the selected element like its standard behaviour when Chart1.Hover.Visible:=TRUE ?
Best regards,
Klaus
Re: control TChartSeries hover effect manually
Hello,
You can assign the pen and color to the whole series at the OnClick eventif you want. Ie:
You can assign the pen and color to the whole series at the OnClick eventif you want. Ie:
Code: Select all
uses Series, TeCanvas;
var oldPen: TTeePen;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.View3D:=false;
with Chart1.AddSeries(TLineSeries) do
begin
FillSampleValues();
OnClick:=SeriesClick;
end;
oldPen:=TTeePen.Create(nil);
Chart1.Hover.Visible:=false;
end;
procedure TForm1.SeriesClick(Sender:TChartSeries; ValueIndex:Integer; Button:TMouseButton; Shift: TShiftState;
X, Y: Integer);
begin
if Sender.Pen.Width=1 then
begin
oldPen.Assign(Sender.Pen);
oldPen.Color:=Sender.Color;
Sender.Pen.Assign(Chart1.Hover.Pen);
Sender.Color:=Chart1.Hover.Pen.Color;
end
else
begin
Sender.Pen.Assign(oldPen);
Sender.Color:=oldPen.Color;
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |