method Chart.ScrollTo (Date as Date, [Align as Variant])
Scrolls the chart so the specified date is visible.

 TypeDescription 
   Date as Date A Date expression that indicates the date being ensured that's visible.  
   Align as Variant An AlignmentEnum expression that indicates where the date will be placed.   
Use the ScrollTo method to ensure that specified date fits the chart's area. The FirstVisibleDate property specifies the first visible date. The ScrollTo method fires the DateChange event if the first visible date is changed. Use the Zoom method to zoom the chart to a specified interval of dates. Use the PaneWidth property to specify the width of the chart. Use the Scroll method to scroll vertically the control. Use the EnsureVisibleItem method to ensure that a specified item fits the control's client area. Use the ScrollPos property to get the control's scroll position. Use the EnsureVisibleColumn method to ensure that a specified column fits the control's client area. 

The following VB sample ensures that the "6/1/2005" is listed in the center of the chart:

With G2antt1.Chart
    .ScrollTo #6/1/2005#, AlignmentEnum.CenterAlignment
End With

The following C++ sample ensures that the "6/1/2005" is listed in the center of the chart:

COleDateTime date( 2005, 6, 1, 0, 0, 0 );
CChart chart = m_g2antt.GetChart();
chart.ScrollTo( date.m_dt, COleVariant( (long)1 ) );

The following VB.NET sample ensures that the "6/1/2005" is listed in the center of the chart:

With AxG2antt1.Chart
    .ScrollTo(DateTime.Parse("6/1/2005"), EXG2ANTTLib.AlignmentEnum.CenterAlignment)
End With

The following C# sample ensures that the "6/1/2005" is listed in the center of the chart:

axG2antt1.Chart.ScrollTo(DateTime.Parse("6/1/2005"), EXG2ANTTLib.AlignmentEnum.CenterAlignment);

The following VFP sample ensures that the "6/1/2005" is listed in the center of the chart:

With thisform.G2antt1.Chart
	.ScrollTo( "6/2/2005", 1 )
EndWith

 


Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.