Depends what you mean with a better way? If this is a common thing you do, you could create an addin/add script to jmps menus/toolbar which you could ran to do this. To create column you could use something like this (and if you want to create the graph builder always when script is ran, it can also be easily added):
Names Default To Here(1);
Local({dt},
dt = Current Data Table();
If(N Cols(dt) == 1,
dt << New Column("no", Numeric, Ordinal, << Set Each Value(Row()))
);
);
You can also add the column directly from New Columns:
Or create temporary column when using graph builder:
This column can be added to Data table if needed:
-Jarmo