Consulting

Results 1 to 5 of 5

Thread: Datalabels not appearing on chart

  1. #1
    VBAX Regular
    Joined
    Jul 2005
    Posts
    74
    Location

    Datalabels not appearing on chart

    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.

  2. #2
    VBAX Expert
    Joined
    Feb 2005
    Posts
    929
    Location
    Quote Originally Posted by clvestin
    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?
    "It's not just the due date that's important, it's also the do date" [MWE]

    When your problem has been resolved, mark the thread SOLVED by clicking on the Thread Tools dropdown menu at the top of the thread.

  3. #3
    VBAX Tutor
    Joined
    Mar 2005
    Posts
    268
    Location
    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?

  4. #4
    VBAX Regular
    Joined
    Jul 2005
    Posts
    74
    Location
    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.

  5. #5
    VBAX Regular
    Joined
    Jul 2005
    Posts
    74
    Location
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •