Page 1 of 1
Scrolling-Questions...
Posted: Wed Nov 29, 2006 2:42 pm
by 8577300
Hello Experts!!
I read the tutorial about scrolling the chart....I try it out with my chart and i had some question:
+) From the tutorial....
Scroll
To scroll a Chart across, press the left mousebutton and, maintaining the mousebutton pressed, drag the mouse in the direction you wish to scroll the Chart. When you release the mousebutton the Chart will remain at the new location.
When I scroll the chart like describe above and release the button, then the chart is still in the origin position??!!
I scroll with the right mousebutton....is that a problem??
+) Is it possible that I only can scroll the chart between the x-axis-minimum and x-axis-maximum?? It don't make sense for me to show the chart before time < 0 sec. or time > x-axis-maximum??!!
Bye
Thomas
Posted: Wed Nov 29, 2006 3:33 pm
by narcis
Hi Thomas,
When I scroll the chart like describe above and release the button, then the chart is still in the origin position??!!
I scroll with the right mousebutton....is that a problem??
No, this is default behaviour. The information is wrong in the tutorial, zoom and scroll mouse buttons are inverted there.
+) Is it possible that I only can scroll the chart between the x-axis-minimum and x-axis-maximum?? It don't make sense for me to show the chart before time < 0 sec. or time > x-axis-maximum??!!
Have you tried using this?
Chart1.ClipPoints:=true;
If you don't want the axes to scalle automatically you can fix their minimum and maximum values using their SetMinMax method:
Code: Select all
Chart1.Axes.Bottom.SetMinMax(0,100);
Posted: Thu Nov 30, 2006 6:42 am
by 8577300
Good morning to everybody...
Have you tried using this?
Quote:
Chart1.ClipPoints:=true;
Yes my ClipPoints are on true....but when I scroll my chart in left or right direction then it always 'jumps' back to the origin position like a rubber band.
If you don't want the axes to scalle automatically you can fix their minimum and maximum values using their SetMinMax method:
Code:
Chart1.Axes.Bottom.SetMinMax(0,100);
I think there is a misunderstood...I meant not scale....I meant scroll between my first and my last value.
I have also problems with this:
My chart has a timeline of 60secs and I added my values over this time...ok!!
But at the first second I only want to show only the values between second 0 and second 10.
At the next second I want to show the values between second 1 and second 11......and so on....how can I do this??
Bye
Thomas
Posted: Thu Nov 30, 2006 7:04 am
by Marjan
Hi, Thomas.
I meant scroll between my first and my last value.
For this you have to know the range you want to display. The "visible" part of values is defined by axis minimim and axis maximum. Scrolling is performed as follows:
1) You set axis minimum and maximum (see also answer to your question bellow). This defines your "visible" window of values.
2) Scrolling is then performed by changing the axis minimum AND maximum values i.e. by using the following relations:
min := min + offset
max := max + offset
Also, please check the following article about axis scroll/zoom:
http://www.teechart.net/reference/modul ... icle&sid=9
at the first second I only want to show only the values between second 0 and second 10.
You can still use the same approach. Scrolling and zooming is in effect changing axis minimum and maximum value. So you can still use SetMinMax method to limit the range you want to display. For example, you start with:
Code: Select all
var min,max,step: double;
begin
min := 0.0;
max := DateTimeStep(dtTenSeconds);
step := DateTimeStep(dtOneSecond);
// show 10 seconds
Chart1.Axes.Bottom.SetMinMax(min,max);
and then "scroll" displayed range with:
Code: Select all
Chart1.Axes.Bottom.SetMinMax(min+step,max+step);