Dundas Chart for Windows Forms
IntervalOffset Property
See Also  Example Send comments on this topic.
DundasWinChart Assembly > Dundas.Charting.WinControl Namespace > Cursor Class : IntervalOffset Property


Gets or sets the interval offset, which affects where an axis' cursor and range selection can be drawn when set by a user.
Cursor movement interval offset.

Syntax

Visual Basic (Declaration)  
Public Property IntervalOffset As Double
Visual Basic (Usage) Copy Code
Dim instance As Cursor
Dim value As Double
 
instance.IntervalOffset = value
 
value = instance.IntervalOffset
C#  
public double IntervalOffset {get; set;}

Return Value

A double which represents the offset from the interval.  Defaults to zero (no limitations), and negative values are allowed.

Example

C# Copy Code
using Dundas.Charting.WinControl;
  ...
// Enable range selection and cursor user interface, respectively.
chart1.ChartAreas["Default"].CursorX.UserEnabled = true;
chart1.ChartAreas
["Default"].CursorX.UserSelection = true;

// Set the interval property for 1 week.
chart1.ChartAreas["Default"].CursorX.Interval = 1;
chart1.ChartAreas
["Default"].CursorX.IntervalType = DateTimeIntervalType.Weeks;

// Set the offset to 6 days (Sunday is considered the first day,
// so an offset of 6 days specifies Saturdays).
chart1.ChartAreas["Default"].CursorX.IntervalOffset = 6;
chart1.ChartAreas
["Default"].CursorX.IntervalOffsetType = DateTimeIntervalType.Days;
Visual Basic Copy Code
Imports Dundas.Charting.WinControl
   ...
' Enable range selection and cursor user interface, respectively.
chart1.ChartAreas("Default").CursorX.UserEnabled = True
chart1.ChartAreas("Default").CursorX.UserSelection = True

' Set the interval property for 1 week.
chart1.ChartAreas("Default").CursorX.Interval = 1
chart1.ChartAreas("Default").CursorX.IntervalType = DateTimeIntervalType.Weeks

' Set the offset to 6 days (Sunday is considered the first day,
' so an offset of 6 days specifies Saturdays).
chart1.ChartAreas("Default").CursorX.IntervalOffset = 6
chart1.ChartAreas("Default").CursorX.IntervalOffsetType = DateTimeIntervalType.Days

Remarks

This property determines the interval offset of a cursor and the beginning/end points of a range selection, and in conjunction with the Interval property determines where a cursor and range can be displayed within a chart area.  A value of zero (the default) means that there is no offset.

The unit of measurement is determined by the IntervalOffsetType property.

Note that when dealing with dates and times Sunday is considered the first day of the week.

The offset affects the locations at which a cursor and the beginning/end points of a range selection can be drawn.  For example, to allow a cursor to only be displayed every Saturday an interval of 1 week should be specified, along with an interval offset of 6 days (in .NET Sunday is considered the first day of the week).  See the sample code below for an example of this.

If the cursor user interface is enabled (via the UserEnabled property), and the mouse is clicked inside a chart area the position of the cursor will be set to the nearest allowable location.

IMPORTANT:  the interval-related properties have no effect when a range selection or cursor position are set programmatically.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2009 All Rights Reserved.