PDA

View Full Version : [SOLVED] Datalabels not appearing on chart



clvestin
08-18-2005, 03:58 PM
I have a series plotted as error bars. I apply datalabels to the three values(think SPC here, namely Upper control limit, average, and lower control limit). On my home machine the three datalabels appear ==On another machine they don't. Both are running Windows 2000.



Set ns = ch.Chart.SeriesCollection.NewSeries
ns.Values = seriescont
ns.AxisGroup = xlSecondary
"Some other code"
With ns
.ChartType = xlXYScatter
.ErrorBar direction:=xlX, include:=xlMinusValues, _
Type:=xlFixedValue, amount:=30
End With
"Some other code"
With ns
.HasDataLabels = True
.MarkerStyle = xlNone
.ApplyDataLabels Type:=xlShowValue
.DataLabels.Position = xlLabelPositionRight
.DataLabels.Font.Size = 8
End With

This seems to be a common occurence with vba==all the machine specific problems==Any suggestions would be appreciated.

MWE
08-18-2005, 06:27 PM
I have a series plotted as error bars. I apply datalabels to the three values(think SPC here, namely Upper control limit, average, and lower control limit). On my home machine the three datalabels appear ==On another machine they don't. Both are running Windows 2000.



Set ns = ch.Chart.SeriesCollection.NewSeries
ns.Values = seriescont
ns.AxisGroup = xlSecondary
"Some other code"
With ns
.ChartType = xlXYScatter
.ErrorBar direction:=xlX, include:=xlMinusValues, _
Type:=xlFixedValue, amount:=30
End With
"Some other code"
With ns
.HasDataLabels = True
.MarkerStyle = xlNone
.ApplyDataLabels Type:=xlShowValue
.DataLabels.Position = xlLabelPositionRight
.DataLabels.Font.Size = 8
End With

This seems to be a common occurence with vba==all the machine specific problems==Any suggestions would be appreciated.
You state that both machines are running Win2K. What is probably more important is what version of Excel each machine is running. Can you repost with a sample spreadsheet attached?

BlueCactus
08-18-2005, 09:08 PM
I have encountered problems on Excel 2000 where changing chart attributes inside a With... End With block does not cause the chart to update until some attribute is changed after the With... End With block. Could this be what you're seeing?

clvestin
08-19-2005, 08:58 AM
Some additions to my issue:
1)I am running Excel 9 on each machine
2) One of the datalabels does appear (the top one, my upper control limit)=also, when i run my mouse over the area where the other datalabels should be, a box appears which leads me to the datalabel format dialog=it appears the label is in fact there, but i don't see it!

Thx for the advice on the With-End With=i may pursue that.

clvestin
08-27-2005, 05:14 AM
OK-the labels print in excel land somewhere. When i assigned the array to the new series,namely {+ucl, ave, -lcl}, excel added the xvalues 1,2,3 to the series. I added a new array for the values containing only ones, ie{1,1,1} and assigned it to ns.XValues.


Set ns = ch.Chart.SeriesCollection.NewSeries
ns.XValues=onearray
ns.Values = seriescont
ns.AxisGroup = xlSecondary