AddDoughnutPlot Method

The AddDoughnutPlot method creates a new doughnut plot. Returns an AutoDoughnutPlot object.

Syntax

object.AddDoughnutPlot( worksheet, dataCol, labelsCol, id )

Parameter Type Description
worksheet String required, data's full path and file name
dataCol Variant optional, default = 1 (column A)
labelsCol Variant optional, default = 2 (column B)
id Variant optional, plot name

 

Example 1

This example shows how to create a doughnut plot.

Shapes.AddDoughnutPlot(GrapherApp.Path + "\samples\doughnutplot.dat")

Example 2

This example demonstrates how to combine several doughnut plots and combine into a composite.

Set DoughnutPlot1 = Shapes.AddDoughnutPlot(GrapherApp.Path + "\samples\doughnutplot.dat")

Set DoughnutPlot2 = Shapes.AddDoughnutPlot(GrapherApp.Path + "\samples\doughnutplot.dat",3,4)

 

'Set hole size

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

 

Used by: AutoShapes collection