Dundas Chart for ASP.NET
InsertEmptyPoints(Double,IntervalType,String) Method
See Also  Example Send comments on this topic.
Dundas.Charting.WebControl Namespace > DataManipulator Class > InsertEmptyPoints Method : InsertEmptyPoints(Double,IntervalType,String) Method


interval

The interval that is checked for missing data points.


Interval size.
intervalType
The unit of measurement for the interval parameter.
Interval type.
seriesName
The name(s) of the series  that will have data points grouped together. For multiple series use a comma-separated list, or use an asterisk (*) to group all existing series.
Series name to insert the empty points in.

Replaces one or more series' missing data points with empty points. Each series is checked for a given interval that is determined by the interval and intervalType 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 seriesName As String _
) 
Visual Basic (Usage) Copy Code
Dim instance As DataManipulator
Dim interval As Double
Dim intervalType As IntervalType
Dim seriesName As String
 
instance.InsertEmptyPoints(interval, intervalType, seriesName)
C#  
public void InsertEmptyPoints( 
   double interval,
   IntervalType intervalType,
   string seriesName
)

Parameters

interval

The interval that is checked for missing data points.


Interval size.
intervalType
The unit of measurement for the interval parameter.
Interval type.
seriesName
The name(s) of the series  that will have data points grouped together. For multiple series use a comma-separated list, or use an asterisk (*) to group all existing series.
Series name to insert the empty points in.

Example

The following sample demonstrates how to insert empty points for every day 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. When the InsertEmptyPoints method is called an empty point will then be inserted for each Saturday and Sunday.

Visual Basic Copy Code
Imports Dundas.Charting.WebControl
  ...

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

' Initialize variables
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

' Empty points will be inserted for Saturdays and Sundays. We check for missing data for each day
Chart1.DataManipulator.InsertEmptyPoints(1, IntervalType.Days, "Series1")
C# Copy Code
using Dundas.Charting.WebControl;
 ...

System.DateTime currentDate = DateTime.MinValue;
Random randomValues =
new Random();
Int32 i = 0;

// Initialize variables
currentDate = DateTime.Now.Date;

// Add randomly-sized data points to Series1 if date is not a Saturday or Sunday
for (i = 0; i <= 20; i++)
{
   
if (currentDate.AddDays(i).DayOfWeek > DayOfWeek.Sunday && currentDate.AddDays(i).DayOfWeek < DayOfWeek.Saturday)
   {
       Chart1.Series[0].Points.AddXY(currentDate.AddDays(i), randomValues.Next(0, 100));
   }
}

// Empty points will be inserted for Saturdays and Sundays. We check for missing data for each day.
Chart1.DataManipulator.InsertEmptyPoints(1, IntervalType.Days, "Series1");

Remarks

The series range that is checked for missing data is automatically determined by the minimum and maximum X-values of the series' data points. To check a smaller range use another definition of this function that has fromXValue and toXValue parameters.

Sunday is regarded as the first day of the week. To check one specific day of the week that is not Sunday use another definition of this function that takes an intervalOffset parameter.

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

Copyright © 2001 - 2009 Dundas Data Visualization, Inc. and others.