My problem is similar to this question SpreadSheetLight Column chart. However the problem is triggered when the number of rows outpace the number of columns, the chart automatically "invert" converting to a Row chart, where column chart is wanted.
The data set is generated via code however I add it for reference
the resulting chart is this one:
However the intended result is this one (note the number of rows here is <= than number of columns, and that works as intended).
The code I use is pretty simple:
spreadsheet = new SLDocument();
var chart = spreadsheet.CreateChart("Dati", "A1", "M14");
chart.SetChartPosition(0, 0, 22, 10);
chart.PlotDataSeriesAsSecondaryLineChart(2, SLChartDataDisplayType.Normal, false);
spreadsheet.AddChart(cart);
spreadsheet.SaveAs(memoryStream);
Original attemp, with same behaviour was achieved via this code:
spreadsheet = new SLDocument();
var chart = spreadsheet.CreateChart("Dati", "A1", "M14");
chart.SetChartPosition(0, 0, 22, 10);
chart.SetChartType(SpreadsheetLight.Charts.SLLineChartType.Line);
spreadsheet.AddChart(cart);
spreadsheet.SaveAs(memoryStream);
Note that the problem cannot be fixed by "Transposing" (inverting rows with columns) because the problem is still present (in the opposite fashion). I could reproduce the behavior whenever the numer of rows is greater than the number of columns. Actually I have 13 columns and 14 ore more rows, but the problem is still present if I use 10 columns and 11 or more rows.
Hard-limiting the number of rows is not an option because a use case is comparison of 20 trend lines.