+ Reply to Thread
Results 1 to 4 of 4

Adding Chart labels dynamically

  1. #1
    Registered User
    Join Date
    06-03-2013
    Location
    stl
    MS-Off Ver
    Excel 365
    Posts
    3

    Adding Chart labels dynamically

    chart example.PNG


    I have a chart that will be updated based on some user inputs and calculation outputs. The chart is comparing two products and their payback. There are some chart elements and labels that I want to create, but not sure how to do them dynamically.

    1. The vertical line is at a point of payback. I need a label to show what that value is.
    2. The calculation is over the course of a maximum of 10 years. The user has the choice to pick something smaller than that. Whatever they input (lets say 7 years), that should be the max value on the "X" axis.
    3. The three labels along the line show a difference in operating cost. Those three points are at 1/3 multiples of the total time duration given in step 2. So if the total is 7 years, or 84 months, the points should be at 28, 56, and 84 months. There is a value stored for each of these points and where the points are along the "X" axis. I can call these values from a VBA script.

    This will help make this chart much more useful and easier to read. Any help is much appreciated!

    Tim

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,826

    Re: Adding Chart labels dynamically

    Here's how I would probably do it:

    1) For the payback line, use one of the techniques here for adding a vertical line to a line chart: https://peltiertech.com/Excel/Charts/ChartIndex.html
    2) Your profile says you are using Excel 2010, which does not have built in support for "data labels -> values from cells". I like to use Rob Bovey's XY chart labeler add-in (appspro.com) for this task, but you can build your own data labeling tool as well. The basic idea is to link a cell (where you can dynamically build the text) to one of the data labels for this series.
    3) For the other label points, add another XY scatter series that positions the label where you want, then link the data labels for that series to cells.

    That's how I would do it. Any questions about building and XY scatter + line combination chart? Adding data labels to any of the points/series?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    06-03-2013
    Location
    stl
    MS-Off Ver
    Excel 365
    Posts
    3

    Re: Adding Chart labels dynamically

    I havent updated my profile in a while. This is Office 365 Pro Plus.

    I was able to add the vertical line, but for some reason, cannot get a data label to show up on it.
    Last edited by alfordtp; 10-11-2019 at 03:59 PM.

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,826

    Re: Adding Chart labels dynamically

    MSFT's help file for adding data labels: https://support.office.com/en-us/art...2-f467c9f4eb2d I'm not sure I can add anything without knowing exactly what difficulty you are having with the data labels.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Adding Axis Labels to a Chart
    By dflak in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-03-2018, 02:22 AM
  2. Adding Horizontal Axis Labels to Chart without Selecting the chart
    By Jonathan78 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-31-2017, 11:32 AM
  3. [SOLVED] Adding Horizontal Axis Labels to Chart without Selecting the chart
    By Jonathan78 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-26-2017, 04:02 PM
  4. Adding labels to a scatter chart
    By Jamie100 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 12-18-2014, 04:01 AM
  5. Replies: 11
    Last Post: 02-18-2014, 09:03 AM
  6. Replies: 3
    Last Post: 12-19-2010, 11:04 AM
  7. Adding more data labels to pie chart
    By ctolson in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-25-2010, 10:21 AM

Tags for this Thread

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.6.0 RC 1