See Also

TimeIntervalAdvanced Members  | dotnetCHARTING Namespace

Language

Visual Basic

C#

Show All

See Also Languages dotnetCHARTING Send comments on this topic.

TimeIntervalAdvanced Class

Represents a time interval and instant at which it occurs.

For a list of all members of this type, see TimeIntervalAdvanced members.

Inheritance Hierarchy

System.Object
   dotnetCHARTING.TimeIntervalAdvanced

Syntax

[Visual Basic]
Public Class TimeIntervalAdvanced
[C#]
public class TimeIntervalAdvanced

Remarks

This time is specific down to the millisecond.

Example

[Visual Basic] 

<%@ Page Language="VB" Description="dotnetCHARTING Component" %>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%>
<%@ Import Namespace="System.Drawing" %>
<HTML>
    <HEAD>
        <TITLE>.netCHARTING Sample</TITLE>
        <script runat="server">


Sub Page_Load(sender as Object ,e as EventArgs )


    Chart.TempDirectory = "temp"
    Chart.Debug = true
    Chart2.TempDirectory = "temp"
    Chart2.Debug = true
    Chart.Title = "Multiple Units"
    Chart2.Title = "Custom Start Times"

    ' This sample will demonstrate how to use the advanced TimeInterval features with axis scales.

    ' 2. SETUP AXIS RANGE AND INTERVAL (For Chart)
    ' First we set the x and y axis ranges.
    Chart.XAxis.ScaleRange = new ScaleRange (new DateTime(2005,1,5),new DateTime(2005,9,5))
    Chart.YAxis.ScaleRange = new ScaleRange (new DateTime(2005,1,4,23,30,0),new DateTime(2005,1,5,0,30,0))

    ' This code demonstrates a (2 month) interval.
    Chart.XAxis.TimeInterval = TimeInterval.Month
    Chart.XAxis.TimeIntervalAdvanced.Multiplier = 2
    Chart.XAxis.Label.Text = "2 Month Interval"'

    ' This code demonstrates a (5 Minute) interval.
    Chart.YAxis.TimeInterval = TimeInterval.Minutes
    Chart.YAxis.TimeIntervalAdvanced.Multiplier = 5
    Chart.YAxis.Label.Text = "5 Minute Interval"

    ' 3. SETUP AXIS RANGE AND INTERVAL (For Chart2)
    ' First we set the x and y axis ranges.
    Chart2.XAxis.ScaleRange = new ScaleRange (new DateTime(2005,4,5),new DateTime(2005,6,5))


    ' This code demonstrates a (week starting on tuesday) interval.
    Chart2.XAxis.TimeInterval = TimeInterval.Week
    Chart2.XAxis.TimeIntervalAdvanced.StartDayOfWeek = CInt(DayOfWeek.Tuesday)
    ' Set a format string to include the day part of the date.
    Chart2.XAxis.FormatString = "D"
    Chart2.XAxis.Label.Text = "Interval is week starting on tuesday"

    ' This code demonstrates a (quarter starting on Feb 15th) interval.
    Chart2.YAxis.ScaleRange = new ScaleRange (new DateTime(2004,9,1),new DateTime(2006,1,5))
    Chart2.YAxis.TimeInterval = TimeInterval.Quarter
    ' When specifying a start date, the year part is not important, just month and day.
    ' The date can be specific to the millisecond as the start time.
    Chart2.YAxis.TimeIntervalAdvanced.Start = new DateTime(2005,2,15)
    ' Set a format string to include the day part of the date.
    Chart2.YAxis.FormatString = "d"
    Chart2.YAxis.Label.Text = "Interval is quarter \nstarting on Feb 15th."


    ' 4. ADD DATA
    ' *DYNAMIC DATA NOTE*
    ' This sample uses a static element to populate the chart. To populate
    ' a chart with database data see the following resources:
    ' - Classic samples folder
    ' - Help File > Data Tutorials
    ' - Sample: features/DataEngine.aspx

    ' This element will be used by all the chart.
    Dim el as Element = new Element()
    el.XDateTime = new DateTime(2005,5,5)
    el.YDateTime = new DateTime(2005,1,5)

    Chart.SeriesCollection.Add(new Series("",el))
    Chart2.SeriesCollection.Add(new Series("",el))

End Sub

        </script>
    </HEAD>
    <BODY>
        <DIV align="center">
            <dotnet:Chart id="Chart" runat="server" Width="568px" Height="344px">
            </dotnet:Chart>
            <dotnet:Chart id="Chart2" runat="server" Width="568px" Height="344px">
            </dotnet:Chart>

        </DIV>
    </BODY>
</HTML>

[C#] 

<%@ Page Language="C#" Description="dotnetCHARTING Component" %> 
<%@ Register TagPrefix="dotnet"  Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%> 
<%@ Import Namespace="System.Drawing" %> 
<HTML> 
    <HEAD> 
        <TITLE>.netCHARTING Sample</TITLE> 
        <script runat="server"> 
 
void Page_Load(Object sender,EventArgs e) 

 
    Chart.TempDirectory = "temp"; 
    Chart.Debug = true; 
    Chart2.TempDirectory = "temp"; 
    Chart2.Debug = true; 
    Chart.Title = "Multiple Units";     
    Chart2.Title = "Custom Start Times";     
     
    // This sample will demonstrate how to use the advanced TimeInterval features with axis scales. 
     
    // 2. SETUP AXIS RANGE AND INTERVAL (For Chart) 
    // First we set the x and y axis ranges. 
    Chart.XAxis.ScaleRange = new ScaleRange (new DateTime(2005,1,5),new DateTime(2005,9,5)); 
    Chart.YAxis.ScaleRange = new ScaleRange (new DateTime(2005,1,4,23,30,0),new DateTime(2005,1,5,0,30,0)); 
 
    // This code demonstrates a (2 month) interval. 
    Chart.XAxis.TimeInterval = TimeInterval.Month; 
    Chart.XAxis.TimeIntervalAdvanced.Multiplier = 2; 
    Chart.XAxis.Label.Text = "2 Month Interval"; 
     
    // This code demonstrates a (5 Minute) interval. 
    Chart.YAxis.TimeInterval = TimeInterval.Minutes; 
    Chart.YAxis.TimeIntervalAdvanced.Multiplier = 5; 
    Chart.YAxis.Label.Text = "5 Minute Interval"; 
         
    // 3. SETUP AXIS RANGE AND INTERVAL (For Chart2) 
    // First we set the x and y axis ranges. 
    Chart2.XAxis.ScaleRange = new ScaleRange (new DateTime(2005,4,5),new DateTime(2005,6,5)); 
     
 
    // This code demonstrates a (week starting on tuesday) interval. 
    Chart2.XAxis.TimeInterval = TimeInterval.Week; 
    Chart2.XAxis.TimeIntervalAdvanced.StartDayOfWeek = (int)DayOfWeek.Tuesday; 
    // Set a format string to include the day part of the date. 
    Chart2.XAxis.FormatString = "D"; 
    Chart2.XAxis.Label.Text = "Interval is week starting on tuesday"; 
     
    // This code demonstrates a (quarter starting on Feb 15th) interval. 
    Chart2.YAxis.ScaleRange = new ScaleRange (new DateTime(2004,9,1),new DateTime(2006,1,5)); 
    Chart2.YAxis.TimeInterval = TimeInterval.Quarter; 
    // When specifying a start date, the year part is not important, just month and day.  
    // The date can be specific to the millisecond as the start time. 
    Chart2.YAxis.TimeIntervalAdvanced.Start = new DateTime(2005,2,15); 
    // Set a format string to include the day part of the date. 
    Chart2.YAxis.FormatString = "d"; 
    Chart2.YAxis.Label.Text = "Interval is quarter \nstarting on Feb 15th."; 
     
 
    // 4. ADD DATA 
    // *DYNAMIC DATA NOTE*  
    // This sample uses a static element to populate the chart. To populate  
    // a chart with database data see the following resources: 
    // - Classic samples folder 
    // - Help File > Data Tutorials 
    // - Sample: features/DataEngine.aspx 
     
    // This element will be used by all the chart. 
    Element el = new Element(); 
    el.XDateTime = new DateTime(2005,5,5); 
    el.YDateTime = new DateTime(2005,1,5); 
         
    Chart.SeriesCollection.Add(new Series("",el)); 
    Chart2.SeriesCollection.Add(new Series("",el)); 
 

 
        </script> 
    </HEAD> 
    <BODY> 
        <DIV align="center"> 
            <dotnet:Chart id="Chart" runat="server" Width="568px" Height="344px"> 
            </dotnet:Chart> 
            <dotnet:Chart id="Chart2" runat="server" Width="568px" Height="344px"> 
            </dotnet:Chart> 
 
        </DIV> 
    </BODY> 
</HTML> 

See Also

TimeIntervalAdvanced Members  | dotnetCHARTING Namespace

 

 


2002 - 2005 Webavail Productions Inc. & Corporate Web Solutions Ltd.. All Rights Reserved.