AutoLegendTitle Object

The AutoLegendTitle object controls the legend title settings and it is accessed from AutoLegend object Title property.

Properties

Font

Text

Example

The following script demonstrates how the AutoLegendTitle object is used.

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

 

'Creates a plot document in Grapher and assigns

'it to the variable named "Plot"

Set Plot = GrapherApp.Documents.Add(grfPlotDoc)

 

'Declares PieChart as an object

Dim PieChart As Object

 

'Set the Pie chart to the PieChart object

Set PieChart= Plot.Shapes.AddPieChart("C:\Program Files\Golden Software\Grapher\Samples\pie.dat",1,2)

 

'Declares AutoLegend as an object

Dim AutoLegend As Object

 

'Create a legend and set the legend to the AutoLegend Object

Set AutoLegend = PieChart.AddLegend

 

'Declares AutoLegendTitle as an object

Set AutoLegendTitle As Object

 

'Sets the legend title as the AutoLegendTitle object

Set AutoLegendTitle = AutoLegend.title

 

'Changes the Legend text

AutoLegendTitle.Font.Text = "My Legend Title"

 

'Changes the Legend font color

AutoLegendTitle.Font.Color = grfColorElectricBlue

 

End Sub