If I understand correctly, recognize that switching x/y axes is different from switching "chart by row" vs "chart by column". In your first picture, the data appear to be plotted by rows, where your second picture shows data plotted by columns. Switching between the two pictures should be as simple as pressing the "switch rows/columns" button.
Recording a quick macro while commanding the switch rows/columns button indicates that the property in question is the chart.plotby property (https://msdn.microsoft.com/en-us/lib.../ff822363.aspx ). In VBA, it seems like controlling this should be as easy as adding a thischart.PlotBy=xlrows statement to the code after the chart is created, assuming that the first picture is the correct one.
Bookmarks