Not going to present creation of chart using macro. That can be extensive and depends upon chart type and various options. You can get a basic macro for this in the Andrew Pitonyak book on Open Office Macros Explained → PDF here. Look in section 15.13 Charts about page #541.
The chart is still based upon x & y values but you can get these from the cell. The upper left point of a cell is in
Position and width & height in
oSheet = oSheets.getByName("YOUR_SHEET_NAME")
oCellRangeByName = oSheet.getCellRangeByName("B2:H12")
aPosition = oCellRangeByName.Position
nX = aPosition.X
nY = aPosition.Y
aSize = oCellRangeByName.Size
nHeight = aSize.Height
nWidth = aSize.Width
So in creating the chart, you need the x & y position (nX & nY) and the Width & Height of the chart (nHeight & nWidth).