+ Reply to Thread
Results 1 to 4 of 4

Goal: to draw a line on chart, manually,then have VBA that includes it into the real chart

  1. #1
    Registered User
    Join Date
    11-07-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    8

    Question Goal: to draw a line on chart, manually,then have VBA that includes it into the real chart

    Hello again!

    Ok, the title was not long enough to explain. The real goal is to be able to take measurements from a chart that is already made in excel ( line/series chart ) . Usually, with other software I've used, this is done by drawing a line. Then, that line will have the option to show it's length, somewhere off to the side. (*and if that's all we can do here, then that would be a good goal too).

    I know that we can click on the line and then look at the size of it that way. But it is pretty tedious in the long run, with large amounts of data to go over.

    So, the idea I had was to create (or get help in creating...) a VBA code that could maybe auto-detect a line that is drawn, and then take those coordinates and plot them in the appropriate cells, off to the side of the original data. So, if it's a chart that uses dates, it would find the beginning and ending coordinates of that hand drawn line, (x,y), and plot it in the cells at those dates (y coordinates)... of to the right of the original data that is the main chart.

    Now, in case this is not enough info, or not possible, I'll include info on what the problem I'm facing is...

    any drawn lines on a chart do not stay attached to that chart....when the chart moves, the line stays put rather than moving. (btw I created a scroll chart, so it scrolls to the right and left. (and) as it scrolls, the drawn line just stays there, while the data moves to the left or right. So, I'd like to be able to mark something on the chart and be able to go back later and look at it, but alas, it's very temporary.


    So in review there are really a couple issues here:
    1) is there a handy vba for plotting the size of manually drawn line(drawn onto a chart), off to the side of that line, in a text, so I can read it easily w/out clicking on the line/format....etc.
    2) is there a way to get the line to stay attached to the data, and move with that data? .....
    3) in trying to solve 2, I thought that it might be possible to have a vba that can tell the coordinates of the line, and plot those in chosen cell(s) off to the right of the original chart data...thus making the line a bit more permanent.

    So ?????????????? any ideas here? *Or maybe you have your own brainstorm on how to solve these problems some other way? Even if you choose not to actually write out the code, maybe you can tell me what is possible, so that I may choose to learn it, or hire someone ??

    Thank you sincerely for your time, it really means a lot !

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Goal: to draw a line on chart, manually,then have VBA that includes it into the real c

    Shapes, whether above or embedded within a chart, will not automatically resize/position themselves when chart data changes. To do that you need to draw the line as a data series within the chart.

    As to converting a line to a set of data coordinates that should be possible using it's location and properties of the chart/plotarea/axes

    can you post example of a chart/dataset and drawn line.

    Is the drawn line a complex one or a simple vertical/horizontal datum line?
    Cheers
    Andy
    www.andypope.info

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

    Re: Goal: to draw a line on chart, manually,then have VBA that includes it into the real c

    The real goal is to be able to take measurements from a chart that is already made in excel ( line/series chart ) . Usually, with other software I've used, this is done by drawing a line. Then, that line will have the option to show it's length, somewhere off to the side.
    I have rarely found that Excel's charts are good for actually analyzing data. They do a good job at visualizing data, but not really for analyzing data.

    If this were my project, I would probably be looking for some way to apply some geometry to the problem. If the chart is generated in Excel by Excel, then I would assume there is a table of the data somewhere in the spreadsheet. By applying a little geometry to the problem, I would expect to be able to figure out how to calculate the length of the line from the tabulated data rather than trying to figure out how to calculate the length of the line in the chart.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Registered User
    Join Date
    11-07-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    8

    Thumbs up Re: Goal: to draw a line on chart, manually,then have VBA that includes it into the real c

    Thank you both,
    I had replied with that picture, but it looks like I didn't hit send before leaving. Sorry. Although, it was just a red line drawn over the most basic blue line chart....

    It looks like this may not be possible. But I'll keep looking. Thanks again for your time.
    Last edited by auspicium; 12-09-2013 at 07:37 PM.

+ 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. Excel 2007 : How to draw a horizontal line on a Chart?
    By ThomasHaller in forum Excel General
    Replies: 3
    Last Post: 12-06-2011, 06:00 AM
  2. Line Chart That Includes Upper and Lower Limits
    By skeezix in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 09-26-2006, 10:00 PM
  3. How to draw a line on a chart, and have it move with the chart?
    By manxman in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-09-2006, 01:40 PM
  4. How to draw an line chart starting at column 1
    By Xaver Hinterhuber in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 06-06-2005, 04:05 AM
  5. I want to draw a line through the columns of a chart, plot the o.
    By Dewey in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-14-2005, 08:06 PM

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