I used the folowing code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'simple example of
' dynamically positioning chart and
' assigning values to a single series chart
'you must have a defined range of series names
' and a defined range for the columns containing the Values
'NOTE: Use the Watch Window or Object Browser to discover Object Properties
Dim iColCount As Integer
With Target.Parent.ChartObjects(1) 'the Target's Parent is the Worksheet
If Not Intersect(Target, [seriesnames]) Is Nothing Then 'only selection in the range
If Target.Count = 1 Then 'only if ONE cell selected
.Visible = True
With .Chart.ChartArea 'position chart
.Top = Target.Top + 30
.Left = Target.Left + Target.Width
End With
With .Chart.SeriesCollection(1) 'assign SeriesCol properties
iColCount = Target.Parent.UsedRange.Columns.Count
.Values = Intersect(Target.EntireRow, Range(Cells(1, 2), Cells(1, iColCount)).EntireColumn)
.Name = Target.Value
End With
End If
Else 'chart not visible
.Visible = False
End If
End With
End Sub