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


Gets or sets the interval type of an axis' cursor and selected range.
Cursor movement interval type.

Syntax

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

Return Value

A DateTimeIntervalType enumeration value.

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

Determines the type of interval, which is specified using the Interval property.

If the interval type is "Auto" the interval's unit of measurement is then treated as a Double, which is equivalent to one day when dealing with DateTimes.  

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

IMPORTANT: If the axis interval type is a time (e.g. hours, minutes, etc.) then in order to have zooming function correctly the Cursor.IntervalType must be set to a time value as well .  For example, if ChartArea1.AxisX.IntervalType is hours then ChartArea1.CursorX.IntervalType could be set to minutes. 

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.