+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    11-06-2009
    Location
    Lorton, VA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Programmatically placing data labels

    I have a chart that is displaying percents but I want to add a count to it, which is whole numbers so I have to display the data labels only to not dwarf the percent bars. I need these data labels to appear directly above the series bar for the corresponding category and it is always changing so I can't use
    DataLabel.Left=somenumber
    DataLabel.Top=somenumber
    I have to find the height of the corresponding series bar and then go
    DataLabel.Left=height of bar + 1
    or something.

    Any help would be greatly appreciated!!

    Thanks
    Last edited by jsmath22; 11-09-2009 at 08:29 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,944

    Re: Programmatically placing data labels

    can you post example so we can better see and unsertand your problem
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    11-06-2009
    Location
    Lorton, VA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Programmatically placing data labels

    I have attached an example of the graph.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,944

    Re: Programmatically placing data labels

    No showing. Maybe the file is too big.
    Cheers
    Andy
    www.andypope.info

  5. #5
    Registered User
    Join Date
    11-06-2009
    Location
    Lorton, VA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Programmatically placing data labels

    OK, there it is. Unfortunately I cannot post the actual graph, it is work, secure data, blah blah. The graph I am dealing with is a little bit more complex, there are 4 series I am plotting so putting the data label at the bottom makes it hard to see. So I need to take those numbers and put it directly above the bar.

    So I need to assign
    ActiveChart.SeriesCollection(1).Points(1)."height"
    (but the height object doesn't exist) this to a variable.
    Attached Images Attached Images

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,944

    Re: Programmatically placing data labels

    Add a dummy series and plot on the secondary axis.
    Use the & values and the Count as the cateogry labels.

    Then display the data labels showing category.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  7. #7
    Registered User
    Join Date
    11-06-2009
    Location
    Lorton, VA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Programmatically placing data labels

    That totally worked, the graph looks totally awesome! Thank you verry much!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0