first check if x and y axis are provided then fetch the records