ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   coordinate of cursor on a chart (https://www.excelbanter.com/charts-charting-excel/202678-coordinate-cursor-chart.html)

AA2e72E

coordinate of cursor on a chart
 
Is there a way to:

1. Get something like a tooltip message to come up when the mouse cursor
hovers over a chart? The message itself should give the coordinates of the
cursor head.

2. If 1 is impossible: if I specify the x,y coordinate in two cells, is
there a way whereby I can get that point to show on an existing chart?

Thanks for your help.

Andy Pope

coordinate of cursor on a chart
 
Hi,

You would need to create code for this.
Jon's article will help get you started. Chart Events in Microsoft Excel
http://www.computorcompanion.com/LPMArticle.asp?ID=221

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"AA2e72E" wrote in message
...
Is there a way to:

1. Get something like a tooltip message to come up when the mouse cursor
hovers over a chart? The message itself should give the coordinates of the
cursor head.

2. If 1 is impossible: if I specify the x,y coordinate in two cells, is
there a way whereby I can get that point to show on an existing chart?

Thanks for your help.



David Biddulph[_2_]

coordinate of cursor on a chart
 
For an answer to your question 2, copy the xy co-ords, and paste special
into your chart as a new series.
--
David Biddulph

"AA2e72E" wrote in message
...
Is there a way to:

1. Get something like a tooltip message to come up when the mouse cursor
hovers over a chart? The message itself should give the coordinates of the
cursor head.

2. If 1 is impossible: if I specify the x,y coordinate in two cells, is
there a way whereby I can get that point to show on an existing chart?

Thanks for your help.




PBezucha

coordinate of cursor on a chart
 
Hi,
(2) As there are usually several such points that should be marked, the
following procedure appered many times invaluable:

Sub MarkerColor()


'Sub changes the colors of individual markers in the selected series
'of x-y chart into the colors of the fonts of parent cell v a l u e s.
'It keeps the marker interior the way as defined for the whole series:
'either empty, or of uniform color. If, however, the background
'of any value cell is light gray, the interior of corresponding
'marker changes into its opposite, i.e. if the series has been declared
'as marker full then such a marker turns to empty and vice versa.
'If the cell background is medium gray, the marker optically disappears.
'The aim is to identify individual markers or their groups within
'one complete series on an x-y chart without having to decompose
'the parent range into subranges.

Dim SP As Points, W As Range
Dim ErrMsg As String, SPF As String, Rng As String
Dim I As Long, N As Long, PosComma As Long, ICI As Long, FCI As Long
Dim MarkersAreEmpty As Boolean

Const Comma = ",", LightGray = 15, MediumGray = 48

ErrMsg = "No series has been selected"
On Error GoTo ErrExit
Set SP = Selection.Points
MarkersAreEmpty = Selection.MarkerBackgroundColorIndex = xlNone
N = SP.Count
SPF = SP.Parent.Formula
I = 3
Do
I = I + 1
Rng$ = Right(SPF, I)
Loop Until Left(Rng, 1) = "!"
Rng = Right(Rng, Len(Rng) - 1)
PosComma = Application.WorksheetFunction.Search(Comma, Rng)
Rng = Left(Rng, PosComma - 1)
Set W = Range(Rng)
For I = 1 To N
FCI = W.Cells(I).Font.ColorIndex
On Error GoTo Skip
SP(I).MarkerForegroundColorIndex = FCI
ICI = W.Cells(I).Interior.ColorIndex
If ICI = LightGray Then
If MarkersAreEmpty Then
SP(I).MarkerBackgroundColorIndex = FCI
Else
SP(I).MarkerBackgroundColorIndex = xlNone
End If
ElseIf ICI = MediumGray Then
SP(I).MarkerForegroundColorIndex = xlNone
SP(I).MarkerBackgroundColorIndex = xlNone
Else
If Not MarkersAreEmpty Then
SP(I).MarkerBackgroundColorIndex = FCI
Else
SP(I).MarkerBackgroundColorIndex = xlNone
End If
End If
Skip:
Next I
Resume Next
Exit Sub

ErrExit:
MsgBox ErrMsg$
On Error GoTo 0
End Sub

Regards
--
Petr Bezucha


"AA2e72E" wrote:

Is there a way to:

1. Get something like a tooltip message to come up when the mouse cursor
hovers over a chart? The message itself should give the coordinates of the
cursor head.

2. If 1 is impossible: if I specify the x,y coordinate in two cells, is
there a way whereby I can get that point to show on an existing chart?

Thanks for your help.



All times are GMT +1. The time now is 03:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com