简体   繁体   中英

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. 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. 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.

选择数据源对话框

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. 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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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