Hi,
Is it possible to establish a SeriesMouseEnter event for a series that is created by a crosstab and therefore doesn't exist until runtime?
I have one series at design time and at runtime, through the actions of the crosstab, it morphs into a total of 6 series. I have a SeriesMouseEnter & SeriesMouseLeave for Series1 and I want the same events to fire for each of the other series.
How do I do this?
Thanks.
Series created by crosstab: SeriesMouseEnter event?
Re: Series created by crosstab: SeriesMouseEnter event?
Hello,
When you use TDBCrossTabSource, the series are created when you activate the dataset associated to it; it can be at runtime but also at designtime.
If you are activating it at runtime, you can loop the series in the chart after it to assign the events for the new series. Ie:
When you use TDBCrossTabSource, the series are created when you activate the dataset associated to it; it can be at runtime but also at designtime.
If you are activating it at runtime, you can loop the series in the chart after it to assign the events for the new series. Ie:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
Table1.Active:=true;
for i:=0 to Chart1.SeriesCount-1 do
begin
Chart1[i].OnMouseEnter:=SeriesMouseEnter;
Chart1[i].OnMouseLeave:=SeriesMouseLeave;
end;
end;
procedure TForm1.SeriesMouseEnter(Sender: TObject);
begin
with Sender as TChartSeries do
Caption:='Series ' + Title + ' entered';
end;
procedure TForm1.SeriesMouseLeave(Sender: TObject);
begin
with Sender as TChartSeries do
Caption:='Series ' + Title + ' left';
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |