AutoAxisDateTime Object

The AutoAxisDateTime object controls the date/time axis label settings. This object is accessed from the AutoAxisTickLabels object's DateTime property.

Properties

Application

AxisIncrement

AxisValue

CustomFormat

Day

Format

Hour

MinorCustomFormat

MinorDTOn

MinorFormat

MinorTimeIncrement

Minute

Month

Parent

Second

TimeIncrement

Year

Example 1

This example shows how to enable the date/time labels for an X axis.

Sub Main

 

 'Declares GrapherApp as an object

  Dim GrapherApp As Object

 

 'Creates an instance of the Grapher Application object

 'and assigns it to the variable named "GrapherApp"

  Set GrapherApp = CreateObject("Grapher.Application")

 

 'Makes Grapher visible

  GrapherApp.Visible = True

 

 'Declares Plot as an object

  Dim Plot As Object

 

 'Creates a plot document in Grapher and assigns

 'it to the variable named "Plot"

  Set Plot = GrapherApp.Documents.Add(grfPlotDoc)

 

 'Declares Shapes as an object

  Dim Shapes As Object

 

 'Assigns the AutoShapes collection to the

 'variable named "Shapes"

  Set Shapes = Plot.Shapes

 

 'Declares Graph as an object

  Dim Graph As Object

 

 'Creates a graph and assigns it to the

 'variable named "Graph"

  Set Graph = Shapes.AddLinePlotGraph(GrapherApp.Path+"\Samples\bar chart orientations.dat")

 

 'Declares Axes as an object

  Dim Axes As Object

 

 'Assigns the AutoAxes collection to the

 'variable named "Axes"

  Set Axes = Graph.Axes

 

 'Declares Axis as an object

  Dim Axis As Object

 

 'Assigns the X axis to the variable named "Axis"

  Set Axis = Axes(1)

 

 'Assigns the X axis labels to be date/time labels

  Axis.TickLabels.mode = grfLabelsDateTime

 

End Sub

 

Example 2

This example shows how to return the month for date/time labels.

Sub Main

 

 'Declares GrapherApp as an object

  Dim GrapherApp As Object

 

 'Creates an instance of the Grapher Application object

 'and assigns it to the variable named "GrapherApp"

  Set GrapherApp = CreateObject("Grapher.Application")

 

 'Makes Grapher visible

  GrapherApp.Visible = True

 

 'Declares Plot as an object

  Dim Plot As Object

 

 'Creates a plot document in Grapher and assigns

 'it to the variable named "Plot"

  Set Plot = GrapherApp.Documents.Add(grfPlotDoc)

 

 'Declares Shapes as an object

  Dim Shapes As Object

 

 'Assigns the AutoShapes collection to the

 'variable named "Shapes"

  Set Shapes = Plot.Shapes

 

 'Declares Graph as an object

  Dim Graph As Object

 

 'Creates a graph and assigns it to the

 'variable named "Graph"

  Set Graph = Shapes.AddLinePlotGraph(GrapherApp.Path+"\Samples\bar chart orientations.dat")

 

 'Declares Axes as an object

  Dim Axes As Object

 

 'Assigns the AutoAxes collection to the

 'variable named "Axes"

  Set Axes = Graph.Axes

 

 'Declares Axis as an object

  Dim Axis As Object

 

 'Assigns the X axis to the variable named "Axis"

  Set Axis = Axes(1)

 

 'Assigns the X axis labels to be date/time labels

  Axis.TickLabels.mode = grfLabelsDateTime

 

 'Returns the month used for the date/time labels

  Debug.Print Axis.TickLabels.DateTime.Month

 

End Sub