Solved

How do I Locate the position of a series and move a text box to it?

Posted on 2011-03-15
4
228 Views
Last Modified: 2012-08-13
I have a chart that has 8 different shapes I want to programatically move and resize.  To do this I think I need to know where the series are located on the chart so I can solve
Left Line - Center Line = Distance1
Center Line + Right Line = Distance2
and use these distance values to set the length of the arrows and the location of the center line to set the start location of the arrows.  I do not need to move these items along the Y-Axis, only the X- Axis.

What I don't know how to do is get the location of my series so I can calculate my distance values.

Below is what the chart is supposed to look like.
Correctly Formated Arrows

Below is what the chart looks like if the data for the Actual Elevation changes.  As you can see the arrows are not between the outermost left and right lines and starting from the center line.
Incorrectly Formated Arrows
0
Comment
Question by:Philippe217
  • 2
  • 2
4 Comments
 
LVL 41

Accepted Solution

by:
dlmille earned 500 total points
ID: 35184477
You can use an Excel4 macro to obtain the X,Y coordinate at any point in a series...

    XVal = ExecuteExcel4Macro("GET.CHART.ITEM(1,2,""S1P" & i & """)")
    yval = ExecuteExcel4Macro("GET.CHART.ITEM(2,2,""S1P" & i & """)")

Attached, I used a recent solution that plots math functions and added a routine to update the datalabels on the chart with their X,Y coordinates (not the data coordinates, but the coordinates you are looking for, I believe).

Is this sufficient for you to take it from here?

Cheers,

Dave
Equation-Charting-with-XY-Coordi.xls
0
 

Assisted Solution

by:Philippe217
Philippe217 earned 0 total points
ID: 35335398
Unfortunatly that didn't do what I needed it to do.

I've ended up converting the shapes into series and displaying their name as the lable and tying their start and end points to the value of the vertical lines while setting their position in the horizontal to a constant.
0
 
LVL 41

Assisted Solution

by:dlmille
dlmille earned 500 total points
ID: 35338701
ok - now, that's an approach.  You can also get the topleft, height, width, etc., from the active chart, then you can derive where the points are based on what point you're charting, normalizing to these chart dimensions, then put your shape there.  I probably should have suggested this route, first - I found a link on it, but was waiting for a response.  If you'd like that link let me know and I'll track it down.  Otherwise, if you have what you need, great!

dave
0
 

Author Closing Comment

by:Philippe217
ID: 35372886
I used my approach to solve this problem.  I can see how your appraoch works but I don't have time to figure out how to implement it.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now