Dear Steema support,
I'd like to prevent an user from doing horizontal mouse scrolling, if the data they browse has reached either side of its end, so the empty area of chart will not be shown? thanks!
How to stop mouse scrolling if certain criteria reached?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: How to stop mouse scrolling if certain criteria reached?
Hi sswang,
Yes, you can use OnScroll event as shown below.
Yes, you can use OnScroll event as shown below.
Code: Select all
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.AddSeries(TLineSeries).FillSampleValues(100);
Chart1.Axes.Bottom.SetMinMax(25,75);
end;
procedure TForm1.Chart1Scroll(Sender: TObject);
var range : Double;
xMin : Double;
xMax : Double;
begin
With Chart1.Axes.Bottom do
begin
xMin:=Chart1[0].MinXValue;
xMax:=Chart1[0].MaxXValue;
range:=Maximum-Minimum;
if Minimum < xMin then SetMinMax(xMin,xMin+range);
if Maximum > xMax then SetMinMax(xMax-range,xMax);
end;
end;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |