SUGGESTION No1
Assuming that your data always begins at cell B8, to set your source data range, you could try something like this. It is likely you need to modify the chart name from Chart2 (see below)
Sub DynamicChartRange()
Dim DataLastRow As Long, DataLastColumn As Long
Dim MyDataRange As Range
Dim DataLastCell As String
'calculate last data rows and columms
DataLastRow = Range("B8").End(xlDown).Row
DataLastColumn = Range("B8").End(xlToRight).Column
DataLastCell = Cells(DataLastRow, DataLastColumn).Address(0, 0)
'set chart data range
Set MyDataRange = Range("B8:" & DataLastCell)
MsgBox "The data range for the chart is set to:" & vbNewLine & MyDataRange.Address(0, 0)
ActiveSheet.ChartObjects("Chart 2").Activate
ActiveChart.SetSourceData Source:=Range("B8:" & DataLastCell)
End Sub
How it works
The code assumes there are no blank cells below B8 until the last row of data, also no blank cells to right of B8 until last column of data range
VBA uses this assumption to arrive at the address of the last cell in range.
MyDataRange is set from B8 to the last cell
My chart was Chart2 . To identify a chart record a macro, activate the chart and then look at the vba from that macro
You could use a similar approach to make the Xvalues dynamic.