Dundas Chart for Windows Forms
InsertEmptyPoints(Double,IntervalType,Double,IntervalType,Double,Double,Series) Method
See Also  Example Send comments on this topic.
DundasWinChart Assembly > Dundas.Charting.WinControl Namespace > DataManipulator Class > InsertEmptyPoints Method : InsertEmptyPoints(Double,IntervalType,Double,IntervalType,Double,Double,Series) Method


interval
The interval that is checked for missing data points.
Interval size.
intervalType
The unit of measurement for the interval parameter.
Interval type.
intervalOffset
The interval offset.
Interval offset size.
intervalOffsetType
The unit of measurement for the intervalOffset parameter.
Interval offset type.
fromXValue
Determines the starting point for the series range to be checked. Uses the X-values of the data points.
Check intervals from this X value.
toXValue
Determines the end point for the series range to be checked. Uses the X-values of the data points.
Check intervals until this X value.
series
The Series object that is checked.
Series to insert the empty points in.

Replaces a series' missing data points with empty points. The series is checked for a given interval that is determined by the interval, intervalOffset, intervalOffsetType and intervalType arguments. The series range that is checked is determined by the toXValue and fromXValue arguments.


Insert empty data points using specified interval.

Syntax

Visual Basic (Declaration)  
Public Overloads Sub InsertEmptyPoints( _
   ByVal interval As Double, _
   ByVal intervalType As IntervalType, _
   ByVal intervalOffset As Double, _
   ByVal intervalOffsetType As IntervalType, _
   ByVal fromXValue As Double, _
   ByVal toXValue As Double, _
   ByVal series As Series _
) 
Visual Basic (Usage) Copy Code
Dim instance As DataManipulator
Dim interval As Double
Dim intervalType As IntervalType
Dim intervalOffset As Double
Dim intervalOffsetType As IntervalType
Dim fromXValue As Double
Dim toXValue As Double
Dim series As Series
 
instance.InsertEmptyPoints(interval, intervalType, intervalOffset, intervalOffsetType, fromXValue, toXValue, series)
C#  
public void InsertEmptyPoints( 
   double interval,
   IntervalType intervalType,
   double intervalOffset,
   IntervalType intervalOffsetType,
   double fromXValue,
   double toXValue,
   Series series
)

Parameters

interval
The interval that is checked for missing data points.
Interval size.
intervalType
The unit of measurement for the interval parameter.
Interval type.
intervalOffset
The interval offset.
Interval offset size.
intervalOffsetType
The unit of measurement for the intervalOffset parameter.
Interval offset type.
fromXValue
Determines the starting point for the series range to be checked. Uses the X-values of the data points.
Check intervals from this X value.
toXValue
Determines the end point for the series range to be checked. Uses the X-values of the data points.
Check intervals until this X value.
series
The Series object that is checked.
Series to insert the empty points in.

Example

The following sample inserts empty points for every Saturday and Sunday between April 2 and April 10, 2003 that does not have a data point. Note that we first add randomly-sized data points to "Series1", but we do not add points if it is Saturday or Sunday.
Visual Basic Copy Code
Imports Dundas.Charting.WinControl
...

Dim currentDate As DateTime
Dim randomValues As New Random()
Dim fromDate As DateTime
Dim toDate As DateTime
Dim i As Int32

'initialize variables
fromDate = "April 2, 2003"
toDate = "April 10, 2003"
currentDate = DateTime.Now.Date

'add randomly-sized data points to Series1 if date is not a Saturday or Sunday
For i = 0 To 20
    If currentDate.AddDays(i).DayOfWeek <> DayOfWeek.Sunday And currentDate.AddDays(i).DayOfWeek <> DayOfWeek.Saturday Then
        Chart1.Series("Series1").Points.AddXY(currentDate.AddDays(i), randomValues.Next(0, 100))
    End If
Next

'insert empty points for Saturdays that are missing data
Chart1.DataManipulator.InsertEmptyPoints(1, IntervalType.Weeks, 6, IntervalType.Days, fromDate.ToOADate(), _
toDate.ToOADate(), Chart1.Series("Series1"))

'insert empty points for Sundays that are missing data
Chart1.DataManipulator.InsertEmptyPoints (1, IntervalType.Weeks, 0, IntervalType.Days, fromDate.ToOADate(), _
toDate.ToOADate(), Chart1.Series("Series1"))

Remarks

When using an IntervalType of IntervalType.Days know that Sunday is regarded as the first day of the week.

To check one specific day of the week that is not Sunday set the intervalOffset parameter to a non-zero value (e.g. a value of "1" will offset the day to be checked from Sunday to Monday).

The drawing style of empty points is set by the Series.EmptyPointStyle property.

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.