X-axis field in grid

Hi,
is there a way to setup by code a field in X-axis section of a grid/chart ?
I need to compare between series and it doesn’t make sense select manually.

regards