Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Non embedded chart location

My goal is to create a chart which zooms in to a region of a chart by
the user clicking twice within the chart's boundaries. I have almost
completed my goal, but now I ran into a problem.

Getting the location (in points) of a chart is easy if the chart is
embedded, just get the .top and .left properties of the chartObject
object. With a non-embedded chart, however, there is no chartObject
object.

I can already convert the clicks to points in my axes (many thanks to
Greg Wilson), but they are shifted by the amount of grey area around the
chart. With the correct zooming (I conpensate for that also) and moving
of the chart so that the upper left corner is positioned so that none of
the grey area is showing in the upper left corner then my current code
works perfectly. Given that this is just about the crudest solution that
I have ever heard of, however, I deemed this unacceptable.

So, if anyone could help me find the top and left of a non-embedded
chart, I would be very grateful.

Thanks,
Jonathan Davis

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Non embedded chart location

Hello Jonthan,

I saw your post on the Excel Forum. Took a while to get here, but I am
finally here.

To find the chart properties you are interested in you need the Excel
name for the chart, like "Chart 1". The non embedded chart is actually a
Shape object. Shapes are a collection that are part of the worksheet
they are placed on. If your code is on the same worksheet you can use...

With Shapes("Chart 1")
H = .Height
L = .Left
T = .Top
W = .Width
End With

If the code is in a macro or you want to access a chart on a different
worksheet then use...

(Change "Sheet1" to match the worksheet you want)
With Worksheets("Sheet1").Shapes("Chart 1")
H = .Height
L = .Left
T = .Top
W = .Width
End With

Your post at the Excel Forum is
http://www.excelforum.com/showthread.php?t=373131

Sincerely,
Leith Ross


*** Sent via Developersdex http://www.developersdex.com ***
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Non embedded chart location



The shapes collection only applies to embedded charts. I am looking for
the top and left (in points) of a stand alone (on a separate sheet)
chart.

Thanks,
Jonathan Davis

*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default Non embedded chart location

I think you're looking for the ActiveWindow.Top and ActiveWindow.Left
properties.

Regards,
Greg Wilson

"Jonathan Davis" wrote:

My goal is to create a chart which zooms in to a region of a chart by
the user clicking twice within the chart's boundaries. I have almost
completed my goal, but now I ran into a problem.

Getting the location (in points) of a chart is easy if the chart is
embedded, just get the .top and .left properties of the chartObject
object. With a non-embedded chart, however, there is no chartObject
object.

I can already convert the clicks to points in my axes (many thanks to
Greg Wilson), but they are shifted by the amount of grey area around the
chart. With the correct zooming (I conpensate for that also) and moving
of the chart so that the upper left corner is positioned so that none of
the grey area is showing in the upper left corner then my current code
works perfectly. Given that this is just about the crudest solution that
I have ever heard of, however, I deemed this unacceptable.

So, if anyone could help me find the top and left of a non-embedded
chart, I would be very grateful.

Thanks,
Jonathan Davis

*** Sent via Developersdex http://www.developersdex.com ***

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting an Embedded Chart Je Charts and Charting in Excel 2 April 2nd 09 05:31 PM
Name Embedded Chart Jen[_4_] Excel Worksheet Functions 1 June 27th 07 02:18 PM
Embedded Table in Chart scott Excel Discussion (Misc queries) 1 November 8th 06 09:27 PM
Embedded Chart Versus Chart - ShowDetail Issue [email protected] Charts and Charting in Excel 1 May 14th 06 04:11 PM
Size and location of an embedded chart Raul[_4_] Excel Programming 2 July 3rd 04 06:04 PM


All times are GMT +1. The time now is 11:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"