Sub main 'Creates an instance of the MapViewer Application object 'and assigns it to the variable named "mvApp" Set mvApp = CreateObject("MapViewer.Application") 'Makes the application main window visible mvApp.Visible = True 'Assigns the location of the samples folder to the variable "InPath" InPath$ = mvApp.ApplicationFolder + "samples\" 'Creates a map document object, and assigns it to the variable named "Plot" Set Plot = mvApp.Documents.Add(DocType:=mvDocPlot) Dim Variables(1 To 3) As Long Variables(1) = 4 Variables(2) = 8 Variables(3) = 6 'Creates a pie map object and assigns it to the variable named "PieMap" Set PieMap = Plot.CreatePieMap(Variables, InPath$+"co2000.gsb", InPath$+"co2000.dat", "","SecondaryIDField=2, Attribute1Field=1", 1) '''''''''''''''''''' 'Sets the state of drawing multi-variable percentage text checkbox PieMap.DrawPercentage = True 'Sets the state of drawing percentage outside pie PieMap.DrawPercentageOutsidePie = True 'Sets the condition of drawing text lead PieMap.DrawTextLead = True 'Specifies the fill properties of variable number 2 PieMap.Fill(2).ForeColor=mvColorPurple PieMap.Fill(2).BackColor=mvColorGreen PieMap.Fill(2).Pattern="Diagonal Cross" PieMap.Fill(2).Transparent=False 'Specifies the font properties of the text labels PieMap.Font.Bold=True PieMap.Font.ForeColor=mvColorBlue PieMap.Font.Size=6 'Sets the state of using Global data from the worksheet PieMap.GlobalData=True 'Sets the condition of drawing percentage text horizontally PieMap.HorzText=True 'Specifies the line properties for the text lead lines PieMap.Line.Color=mvColorBlue PieMap.Line.Width=0.015 'Sets the maximum diameter of the pies PieMap.MaxDiam=0.75 'Sets the minimum diameter of the pies PieMap.MinDiam=0.35 'Sets the PID column of the worksheet PieMap.PIDCol=1 'Sets the 3D pie state PieMap.Pie3D=True 'Sets the 3D pie wall height to 0.1 PieMap.Pie3DWallHeight=0.1 'Sets the condition of using pie color for text PieMap.PieColorForText=True 'Sets the condition of using the pie map color(s) for the text lead lines PieMap.PieColorForTextLead=True 'Sets the pie centroid position offset type to User Defined PieMap.PiePosOffsetType=mvPosOffsetUser 'Sets the pie position X offset In units of 0.001 inch PieMap.PiePosXOffset=0.1 'Sets the pie position Y offset In units of 0.001 inch PieMap.PiePosYOffset=-0.05 'Sets the uniformed 3D pie wall fill state PieMap.PieUni3DWallFill=True 'Sets the scale of the arrow of the text lead line PieMap.TextLeadArrowScale=0.5 'Sets the End arrow of the Text lead Line PieMap.TextLeadEndArrow=mvASTriangle 'Sets the start arrow of the Text lead Line. PieMap.TextLeadStartArrow=mvASSimple 'Sets the text lead line properties PieMap.TextLeadLine.Color=mvColorMartianGreen PieMap.TextLeadLine.Width=0.02 'Sets the text offset from pie edge PieMap.TextOffsetFromPie=0.25 'Sets the state of negative value handling PieMap.UseAbsoluteValue=True 'Sets the variable column of variable 3 To column 15. PieMap.VarCol(3)=18 'Returns the variable column of the worksheet Debug.Print PieMap.VarCol(3) 'Sets the fill properties for 3D pie wall PieMap.WallFill.ForeColor=mvColorOrange PieMap.WallFill.Pattern="Sand" 'Creates a legend for the map Set Legend = PieMap.CreateLegend(-2,6) 'Adds PieMap information in Layer #1 to legend PieMap.AddLayerToLegend("Layer #1") 'Changes the proportion from Linear to Square Root PieMap.LinearProportion=False End Sub