Open sebastianbochan opened 9 years ago
So you want to switch rows and columns.
The module currently exports each series into a column. The reason for that is perhaps best explained by an example. Imagine how it would be to work with long data series like that in a spreadsheet if the data series were laid out in rows.
Related to our work with Highcharts Cloud, we have investigated how other charting tools handle this. Google Spreadsheets always relates columns to series by default. Excel does an intelligent guess based on what is longer. If there are more rows than columns, columns are interpreted as series and vice versa.
What we could do in this module is to add an option, switchRowsAndColumns
. But I believe the default should be kept as it is. Alternatively follow Excel's lead on implementing an intelligent guess, but I think that just complicates things and introduces an unpredictable result when running in a programming environment.
I did a refactoring in export-csv today, so that we can access the raw data rows before concatenated in to CSV. This allows a hook to switch rows and columns: http://jsfiddle.net/highcharts/2oa8a9cx/.
It seems that categories are mixed with series.
Example: http://jsfiddle.net/cqjvD/448/
As a result we should receive