Highlight and Label point on XY graph - Excel 2007

Imgonna

New Member
Joined
Jan 27, 2013
Messages
15
Hi

Working with a data set of schools in Wales - I have an XY graph showing (for example) free school meals (x) and results (y) for up to 200 schools. << The data is pulled via JSON from a government site - and all works well.

I want to be able to click / double click a point on the XY graph - have it change colour / size and display on the graph a label corresponding to the school.

I can find examples to label all the points permanently - no can do, Tushar Mehta's example to pop up when hovered (but I can't remove the 1pt holder text).

I thought this would be a simple ask - but it's totally defeating me.

Data:

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]School Name
[/TD]
[TD]FSM
[/TD]
[TD]Attendance
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]School A
[/TD]
[TD]34.2
[/TD]
[TD]98.2
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]School B
[/TD]
[TD]23.6
[/TD]
[TD]89.1
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]School C
[/TD]
[TD]45.7
[/TD]
[TD]87.1
[/TD]
[/TR]
</tbody>[/TABLE]


My chart on a separate sheet uses B2:C4 (for example)

I'm OK with VBA and use macros - but can not access .exe packaged addins.

Data may be in different columns, but the school name will always be in column A.

Help / advice greatly recieved.

Excel 2007 due to corporate intertia.

Cheers
Glen
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi

Not quite what I was looking for - but a start.

This chart code pops up a message box with the cell details and the name from the worksheet:

Code:
Private Sub Chart_Select(ByVal ElementID As Long, ByVal Arg1 As Long, ByVal Arg2 As Long)
Dim xrange As Integer
Dim yrange As Integer
xrange = 2
If ElementID = xlSeries Then
    If Arg2 > 0 Then
    yrange = Arg2 + 1
     x = Worksheets("Sheet1").Cells(yrange, xrange).Value
        MsgBox "X = " & WorksheetFunction.Index _
                (SeriesCollection(Arg1).XValues, Arg2) & vbCrLf _
            & "Y = " & WorksheetFunction.Index _
                (SeriesCollection(Arg1).Values, Arg2) & vbCrLf & vbCrLf _
            & x
            
    End If
End If
End Sub

This >> pulls the school name: x = Worksheets("Sheet1").Cells(yrange, xrange).Value
 
Upvote 0
where are your x and y values in the table? is B x and C Y? is A meant for Labels?
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top