简体   繁体   English

如何使用 SpreadsheetLight 在 Excel 图表中显示 select 哪个系列?

[英]How do I select which series to display in an Excel chart with SpreadsheetLight?

I'm using SpreadsheetLight to build an Excel file with charts.我正在使用 SpreadsheetLight 构建一个带有图表的 Excel 文件。 I've got a chart based on a range of data in the Excel file, but I only want to include the data from one of the columns in the chart.我有一个基于 Excel 文件中一系列数据的图表,但我只想包括图表中一列的数据。 In Excel itself, I can do this in the Select Data Source dialog by unchecking all the series I don't want to appear in the chart.在 Excel 本身中,我可以在 Select 数据源对话框中通过取消选中我不想出现在图表中的所有系列来执行此操作。

选择数据源对话框

The SpreadsheetLight API has a way to change settings on a series ( SLDataSeriesOptions returned by SLChart.GetDataSeriesOptions ), but I don't see a way to mark the series as "hidden" or anything like that. SpreadsheetLight API 有一种方法可以更改系列的设置( SLDataSeriesOptionsSLChart.GetDataSeriesOptions返回),但我看不到将系列标记为“隐藏”或类似内容的方法。 Is there a way to do this?有没有办法做到这一点?

Please try this Remove SetChartType call Add chart via below method (or similar methods) chart.PlotDataSeriesAsSecondaryLineChart(2, SLChartDataDisplayType.Normal, false);请尝试通过以下方法(或类似方法)删除 SetChartType 调用添加图表 chart.PlotDataSeriesAsSecondaryLineChart(2, SLChartDataDisplayType.Normal, false);

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

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