AutoDoughnutPlot Object
The AutoDoughnutPlot object controls 2D doughnut plot settings.
Derived from: AutoPieChart object (All methods and properties of AutoPieChart apply to this object.)
Properties
Methods
Example 1
This example shows how to reference the doughnut plot.
Sub Main
'Declare the variable that references the application
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
'Declares 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)
'Declares Shapes as Object
Dim Shapes As Object
'Assigns the AutoShapes collection to
'the variable named "Shapes"
Set Shapes = Plot.Shapes
'Declares DoughnutPlot1 as Object
Dim DoughnutPlot1 As Object
'Adds a doughnut plot and assigns it to
'the variable named "Graph1"
Set DoughnutPlot1 = Shapes.AddDoughnutPlot(GrapherApp.Path + "\samples\doughnutplot.dat")
End Sub
Example 2
This example demonstrates how to combine two doughnut plots.
Set DoughnutPlot2 = Shapes.AddDoughnutPlot(GrapherApp.Path + "\samples\doughnutplot.dat",3,4)
DoughnutPlot1.HolePercent = 75
DoughnutPlot2.HolePercent = 66.66
'Set DoughnutPlot2 properties relative to DoughnutPlot1
DoughnutPlot2.Diameter = DoughnutPlot1.Diameter*0.75
DoughnutPlot2.xPos = DoughnutPlot1.xPos
DoughnutPlot2.yPos = DoughnutPlot1.yPos
'Center the labels
DoughnutPlot1.CenterLabels
DoughnutPlot2.CenterLabels
'Combine the doughnut plots
DoughnutPlot1.Select
DoughnutPlot2.Select
Plot.Selection.Combine