Cannot remove data labels from Excel Chart

I use XlsIO to setup a chart in a worksheet:

// get the chart
var rpmTimingChart = sheet.Charts[0];

// the chart contains 2 series, setup values/categories for each one:
var rpmSeries = rpmTimingChart.Series[0];
rpmSeries.CategoryLabels = sheet.Range[.....];
rpmSeries.Values = sheet.Rang[.....];

var timingSeries = rpmTimingChart.Series[1];
timingSeries.CategoryLabels = sheet.Range[.....];
timingSeries.Values = sheet.Range[.....];

// now trying to remove data labels, but does not seem to work
rpmSeries.DataPoints.DefaultDataPoint.DataLabels.IsValue = false;
timingSeries.DataPoints.DefaultDataPoint.DataLabels.IsValue = false;


At the end, the output excel file does contain data label for each point. How can I remove all of them?



1 Reply 1 reply marked as answer

KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team September 28, 2020 11:37 AM UTC

Hi Alessandro, 

Greetings from Syncfusion. 

The following code which you are using at your end, should satisfy your requirement of removing data labels to chart series. 

Code Snippet: 

// now trying to remove data labels, but does not seem to work 
rpmSeries.DataPoints.DefaultDataPoint.DataLabels.IsValue = false; 
timingSeries.DataPoints.DefaultDataPoint.DataLabels.IsValue = false; 

We have tried a simple sample and this seems to be working fine at our end. The sample can be downloaded from the following link. We have shared the input and output Excel documents in Input and Output folder of the sample respectively, for your reference. 


Kindly look into the sample and let us know if it helps. Else, please modify the sample and share us the issue reproducing one, which will be helpful for us in investigating the query and provide prompt solution at the earliest. 

Also please confirm if you are using 18.2.0.44 version of Syncfusion XlsIO at your end. 

Regards, 
Keerthi. 


Marked as answer
Loader.
Up arrow icon