AutoGraphTitle Object

The AutoGraphTitle object controls the graph title settings and it is accessed from AutoGraph object Title property.

Properties

Angle

Background

Fill

FlipText

Font

Line

Position

RotateText

Text

Worksheet

XOffset

YOffset

Example

This example shows how to add a graph title to the existing graph.

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")

 

 'Make Grapher visible

  GrapherApp.Visible = True

 

 'Declare Docs Plot, Shapes, Graph1,

 'and Function1 as Object

  Dim Docs, Plot, Shapes, Graph1, Function1 As Object

 

 'Assigns the Documents collection to

 'the variable named "Docs"

  Set Docs = GrapherApp.Documents

 

 'Creates a new plot window and assigns it

 'to the variable named "Plot"

  Set Plot = Docs.Add(grfPlotDoc)

 

 'Assigns the AutoShapes collection to

 'the variable named "Shapes"

  Set Shapes = Plot.Shapes

 

 'Adds a floating bar chart and assigns

 'it to the variable named "Graph1"

  Set Graph1 = Shapes.AddFunctionPlotGraph2( grfFunctionPlotYX, "2+x")

 

 'Assigns the function plot to the

 'variable named "Function1"

  Set Function1 = Graph1.Plots(1)

 

 'Add a graph title and assign it to

 'the variable named "Title"

  Set Title = Graph1.title

 

End Sub