AutoGradient Object

The AutoGradient object represents a color gradient. Gradient objects are created by calling the Gradient or BubbleGradient property from objects that the support gradient color fill.

  

Properties

Application

Name

Parent

Methods

SetColor

SetColorAndOpacity

SetGradient

Example

The following script demonstrates how the gradient object is used in reference to the Rectangle object.

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 as Object

  Dim Docs As Object

 

 'Assigns the Documents collection to

 'the variable named "Docs"

  Set Docs = GrapherApp.Documents

 

 'Declare Plot As Object

  Dim Plot As Object

 

 'Creates a new plot window and assigns

 'it to the variable named "Plot"

  Set Plot = Docs.Add(grfPlotDoc)

 

 'Create Rectangle

  Set Rectangle = Plot.Shapes.AddRectangle( 2, 5, 7, 2)

 

 'Set the Gradinet fill type to Linear

  Rectangle.Fill.GradientType = grfGradientLinear

 

 'Set the Gradient to "Rainbow"

  Set Gradient = Rectangle.Fill.Gradient

 

 'Set the gradient to the predefined "Rainbow" CLR file

  Gradient.Name = "Rainbow"

 

End Sub