+ Reply to Thread
Results 1 to 9 of 9

Pointer coordinates on chart

  1. #1
    Registered User
    Join Date
    04-10-2010
    Location
    Abu Dhabi, UAE
    MS-Off Ver
    Excel 2003, 2007 and 2010
    Posts
    148

    Question Pointer coordinates on chart

    Hi all,

    I need a code to show the X,Y coordinates (on the status bar for instance) of any position on the chart when moving the cursor on it.
    I used Microsoft code but there is always the message of ( Compile Error)...

    Please help!

    Cheers
    Ralem

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441

    Re: Pointer coordinates on chart

    It would help if you posted what you had or even a link to the MS article.

    Errors not withstanding the main problem is the conversion of mouse xy coordinates and the charts xy coordinates and the scaling of the data contained within the chart.

    You can capture the mouses xy values in the mousemove event. But these values do not correspond with the charts left/top etc values.
    Any conversion is futher complicated by the zoom factor of the chart.

    What exactly are you trying to do?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    04-10-2010
    Location
    Abu Dhabi, UAE
    MS-Off Ver
    Excel 2003, 2007 and 2010
    Posts
    148

    Re: Pointer coordinates on chart

    Thanks Andy for the reply, Below is the link:

    http://support.microsoft.com/kb/152969

    What I'm after is that I have a workbook with a chart where I set a map as a background and made X,Y of the cart axis the same as of the map, I like to add the ability of showing X,Y values when pointing the mouse somewhere on the map/chart, is it possible?

    Cheers
    Ralem

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441

    Re: Pointer coordinates on chart

    The chart has mouse events you can capture. As I say the hard part is converting between coordinate systems.

    To make things easier you can get the user to click top/left and bottom/right of the plotarea. Then you can more easily convert between mouse and chart and data values.

    http://www.computorcompanion.com/LPMArticle.asp?ID=221

    Have you seen this addin?
    http://tushar-mehta.com/excel/softwa...ata/index.html

  5. #5
    Registered User
    Join Date
    04-10-2010
    Location
    Abu Dhabi, UAE
    MS-Off Ver
    Excel 2003, 2007 and 2010
    Posts
    148

    Re: Pointer coordinates on chart

    I believe it can be done somehow by only moving over the chart, and have seen it programmed by java, must be able to be done by VB....

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441

    Re: Pointer coordinates on chart

    I'm sure it can.

    You just have to find the correct formula for all the different coordinate systems.

  7. #7
    Registered User
    Join Date
    04-10-2010
    Location
    Abu Dhabi, UAE
    MS-Off Ver
    Excel 2003, 2007 and 2010
    Posts
    148

    Re: Pointer coordinates on chart

    no it's only one coordinate system which is the chart, the map has same coordinates?

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441

    Re: Pointer coordinates on chart

    you have to deal with the following,

    x and y scale values
    left and top properties of the chart
    x and y mouse coordinates

  9. #9
    Registered User
    Join Date
    04-10-2010
    Location
    Abu Dhabi, UAE
    MS-Off Ver
    Excel 2003, 2007 and 2010
    Posts
    148

    Re: Pointer coordinates on chart

    If you find out please let me know,

    Thanks
    Ralem

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1