?
Solved

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

Posted on 2011-03-15
4
Medium Priority
?
235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 42

Accepted Solution

by:
dlmille earned 2000 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 42

Assisted Solution

by:dlmille
dlmille earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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