Solved

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

Posted on 2011-03-15
4
226 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
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…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

746 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

16 Experts available now in Live!

Get 1:1 Help Now