简体   繁体   English

C#SpreadSheets光轴

[英]C# SpreadSheetsLight axis

i have a spreadsheet with table generated with SpreadsheetLight library, and chart from this table also generated with SpreadsheetLight. 我有一个电子表格,其中包含使用SpreadsheetLight库生成的表,该表中的图表也使用SpreadsheetLight生成。 When i open generated result in excel and select chart, i can change rows for cols with button in excel (i don't have excel in english language so i'm just guessing it is called "change rows and cols"). 当我在excel中打开生成的结果并选择图表时,我可以使用excel中的按钮更改cols的行(我没有英文的excel,所以我只是猜测它被称为“更改行和列”)。 Is there posibility to do this by code with SpreadsheetLight while generating spreadsheet? 生成电子表格时,可以通过SpreadsheetLight代码执行此操作吗? Or is it possible to tell SpreadsheetLight which data should be on category and which on data axis? 还是可以告诉SpreadsheetLight哪些数据应该在类别上,哪些应该在数据轴上?

Thank you for any help. 感谢您的任何帮助。

So the answer for my own question is, that there is an overload of method SLDocument.CreateChart(), where is parameter RowsAsDataSeries. 因此,我自己的问题的答案是,方法SLDocument.CreateChart()的重载,其中参数RowsAsDataSeries。 Or there is also an overload with SLCreateChartOptions parameter, and inside of SLCreateChartOptions is property RowsAsDataSeries. 或者,SLCreateChartOptions参数也有重载,并且SLCreateChartOptions内部是属性RowsAsDataSeries。 Second option seems to be better because the first one is marked as obsolette. 第二种选择似乎更好,因为第一种被标记为过时。

Many thank's to Mr. Vincent Tan for help and for great OpenXml library :) 非常感谢Vincent Tan先生的帮助和出色的OpenXml库:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM