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

444 Views Asked by At

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.

Select Data Souce Dialog

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?

1

There are 1 best solutions below

0
On

Please try this Remove SetChartType call Add chart via below method (or similar methods) chart.PlotDataSeriesAsSecondaryLineChart(2, SLChartDataDisplayType.Normal, false);