+ Reply to Thread
Results 1 to 5 of 5

Movable crosshair on chart with mouseover event

  1. #1
    Registered User
    Join Date
    02-06-2011
    Location
    Indonesia
    MS-Off Ver
    Excel 2003
    Posts
    12

    Movable crosshair on chart with mouseover event

    I have an XY scatter plot and I'd like to add some vertical-horizontal lines (cross-hair) on the plot.

    Is it possible since these lines could also be moved along the x & y axis and follow mouse pointer when chart activated (I guess it required mouseover event) ?
    I'd like the x and y value of the data point on the curve to be displayed within the chart. The location of the data point will vary, so the system needs to be dynamic.

    better explanation can be found in the attachment.
    Attached Images Attached Images
    Last edited by Hendra S; 02-10-2011 at 12:17 AM.

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

    Re: Movable crosshair on chart with mouseover event

    An alternative to mouseevents on the chart
    http://www.andypope.info/ngs/ng26.htm

    Info on chart events
    http://www.computorcompanion.com/LPMArticle.asp?ID=221
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    02-06-2011
    Location
    Indonesia
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Movable crosshair on chart with mouseover event

    Andy,

    I've developed scrollable hair line based on your reference link. instead of modify the marker, I utilize Y-error bars as a vertical line and control toolbox. I link the maximum Y value to Chart_data (cell: P24).
    (excel file can be found in the attachment of this post)

    On my first attempt, I link Y-error bars max value to scale max value (cells:S28). but if I change series option (cell: K27), I get strange result, which min/max value for series-1 will give different value than max value in the chart. Is it possible to tackle this issue ?

    I've also tried to implement simple cross-hair into userform, but when mouse pointer cross the image area, the cross-hair "freeze".

    B'rgrds
    Hendra S
    Attached Files Attached Files
    Last edited by Hendra S; 02-09-2011 at 03:43 AM.

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

    Re: Movable crosshair on chart with mouseover event

    This uses a plus/minus 100% Y error bar. The Y position is in the center of the primary Y axis.

    When determining the Y axis scales the point is set to 1 in order to not influence the Auto scaling.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-06-2011
    Location
    Indonesia
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Movable crosshair on chart with mouseover event

    Andy,

    nice trick to tackle auto-scaling interference. that's the sort of thing I'm after.
    Thanks very much for all your help


    B'rgrds

    Hendra S

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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