Positioning of data labels on 3d pie chart in Access 2002

  • Thread starter Thread starter Kevin
  • Start date Start date
K

Kevin

How can I position data labels of a 3d pie chart in
Access 2002. Unlike Excel, I did not find any positioning
options to move my 3d pie chart's data labels. Please
help me.
Thank you
Kevin
 
Kevin,

First, place your graph on a form so you can "play" with it.
Then add a command button and the following code to check out various
properties and values:

Dim MyGraph As Graph.Chart
Dim oSeries As Graph.Series
Dim oDatalabel As Graph.DataLabel

Set MyGraph = Me.Chart1.Object ' use the name of your chart instead of
Chart1
MyGraph.ChartType = xl3DPie
MyGraph.ApplyDataLabels xlDataLabelsShowNone 'reset labels
MyGraph.ApplyDataLabels Type:=xlDataLabelsShowLabel

'see the Object Browser for various DataLabel properties
MyGraph.SeriesCollection(1).DataLabels.Position = xlLabelPositionBestFit

For Each oDatalabel In MyGraph.SeriesCollection(1).DataLabels
Debug.Print oDatalabel.Top, oDatalabel.Left
oDatalabel.Font.Color = vbRed
oDatalabel.Top = oDatalabel.Top * 1.05
oDatalabel.Top = oDatalabel.Left * 1.05
Debug.Print oDatalabel.Top, oDatalabel.Left
Stop ' Step through code with F8
Next

Set oSeries = Nothing
Set MyGraph = Nothing

Steve
 
Back
Top