Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
In Excel, we can filter out specific series from a chart, causing those filtered series not to be displayed in the chart. The original chart is shown in Figure 1. However, when we filter out Testseries2 and Testseries4,the chart will appear as shown in Figure 2.
In Aspose.Cells, we can perform a similar operation. For a sample file like this, if we want to filter out Testseries2 and Testseries4,we can execute the following code. Additionally, we will maintain two lists: one (NSeries) list to store all the selected series and another (FilteredNSeries) to store the filtered series.
Please note that in the code, when we set chart.NSeries[0].IsFiltered = true;, the first series in NSeries will be removed and placed in the appropriate position within FilteredNSeries. Subsequently, the previous NSeries[1] will become the new first item in the list, and all the following series will shift forward by one position. This means that if we then run chart.NSeries[1].IsFiltered = true;, we are effectively removing the original third series. This can sometimes lead to confusion, so we recommend following the operation in the code, which deletes series from the end to the beginning.


The following sample code loads the sample Excel file.
Filtering your data is a great way to handle chart filters with a lot of data. When you filter the data, the chart will change. One issue we’re going to have to address is making sure the chart stays on the screen. When you filter, you get hidden rows, and occasionally, the chart will be in those hidden rows.

The following sample code shows the same featrue using Aspsoe.Cells.
Using a Table is similar to Method 2, using a range, but you have advantages with tables over ranges. When you change your range to a Table and add data, the chart automatically updates. With a range, you will have to change the data source.
Click inside your data and use CTRL + T or use the Home tab, Format as Table

The following sample code loads the sample Excel file shows the same featrue using Aspsoe.Cells.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.