Solved

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

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

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

705 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