D
diegoo
I am generating a doughnut chart using VBA and am having two immediat
issues:
1) I am using the following line to ensure that the default chart tha
is generated when I invoke the Charts.Add method is a doughnut chart:
Application.SetDefaultChart FormatName:=xlDoughnut
Is there a more elegant approach to ensuring that any chart create
ends up being a doughnut chart, maybe when invoking the Charts.Ad
method? I have tried to specify ChartType = xlDoughnut after th
Charts.Add method but this does not do the trick every time (see cod
snippet below).
2) When the doughnut chart is added (immediately after the execution o
the Chart.Add line), Excel automatically displays a series (calle
Series1) that I do not need or want. Actually I would like to ensur
that the chart is clear of any objects before I plot my own firs
series on it. I am using the following code:
Charts.Add
With ActiveChart
.ChartType = xlDoughnut
.SeriesCollection.NewSeries.Name = "PrimerData"
.SeriesCollection(1).Values = Array(Value1, Value2, Value3, _
Value4)
.Location Where:=xlLocationAsObject, Name:="Sheet2"
End With
PS I would feel honored to hear from Jon, Tushar or Mala... I am reall
digging into charting deep and your names are gold
issues:
1) I am using the following line to ensure that the default chart tha
is generated when I invoke the Charts.Add method is a doughnut chart:
Application.SetDefaultChart FormatName:=xlDoughnut
Is there a more elegant approach to ensuring that any chart create
ends up being a doughnut chart, maybe when invoking the Charts.Ad
method? I have tried to specify ChartType = xlDoughnut after th
Charts.Add method but this does not do the trick every time (see cod
snippet below).
2) When the doughnut chart is added (immediately after the execution o
the Chart.Add line), Excel automatically displays a series (calle
Series1) that I do not need or want. Actually I would like to ensur
that the chart is clear of any objects before I plot my own firs
series on it. I am using the following code:
Charts.Add
With ActiveChart
.ChartType = xlDoughnut
.SeriesCollection.NewSeries.Name = "PrimerData"
.SeriesCollection(1).Values = Array(Value1, Value2, Value3, _
Value4)
.Location Where:=xlLocationAsObject, Name:="Sheet2"
End With
PS I would feel honored to hear from Jon, Tushar or Mala... I am reall
digging into charting deep and your names are gold