I have the following chart:
var ss = ... // get sheet
var chart = ss.newChart().asLineChart();
chart.setTitle(\"My Title\");
chart.addRange(dataSheet.getRang
First off - your code is OK. I took a copy and made minor changes to it just to use a single sheet for illustration:
The problem is likely with your data, specifically the first row. Here's that same example, with some of the "Headers" changed from text into numbers. I believe it is behaving in the bad way you're describing.
One more time, but with the numbers in the header forced to be text. (In the spreadsheet, I input them as '4
and '5
- the leading single quote tells Spreadsheet to treat as text.)
Just take a look at the data types in your first row, and make sure that they are Text.