We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set series value

Thread ID:





125974 Sep 15,2016 10:39 AM UTC Sep 19,2016 12:36 PM UTC UWP 3
Tags: XlsIO
Sharad Kumar
Asked On September 15, 2016 10:39 AM UTC


How to set chart series value in Excel file.
I am using following code.

ExcelEngine oengine = new ExcelEngine();
IApplication oApp = oengine.Excel;
oApp.DefaultVersion = ExcelVersion.Excel2007;
IWorkbook oWorkbook  =  oApp.Workbooks.Create(1);
IWorksheets osheets = oWorkbook.Worksheets;
IWorksheet  osheet = osheets .Worksheets[0];

IChart ochart = osheet.Charts.Add();
IChartSerie oserie = ochart.Series.Add();
oserie.value = "......";

Excel file is attach .This file have contain a chart with two series. In this chart how to set series range value.

sharad kumar

Attachment: 6paretoanalysischartexceltemplate_d51c6039.rar

Kesavan D [Syncfusion]
Replied On September 16, 2016 10:53 AM UTC

Hi Sharad, 

Thank you for contacting Syncfusion support. 

We can set chart series using XlsIO by using below code snippet. 

            IChart chart = sheet.Charts[0]; 
            IChartSerie series = chart.Series.Add(); 
            series.Name = "WP2"; 
            series.Values = sheet.Range["M3:M13"]; 

We have also prepared a sample to illustrate the above code snippet which can be downloaded from below link, 

Feel free to refer our documentation page, 


Sharad Kumar
Replied On September 16, 2016 11:12 AM UTC


Thanks for your replay.

In this file , Two series present in chart.   
 1)         Series Name    ->    Series2
             Series value     ->     ='6pareto-analysis-chart-excel-template.xlsx'!fre
 2)         Series Name    ->    Series3
             Series value     ->     ='6pareto-analysis-chart-excel-template.xlsx'!cum

IChart chart = sheet.Charts[0]; 
IChartSerie series = chart.Series.Add(); 
 series.Name = "WP2"; 
series.Values = sheet.Range["='6pareto-analysis-chart-excel-template.xlsx'!fre"];       // XLSIO liberary throw exception

output file have two series without series value.

Sridhar Sukumar [Syncfusion]
Replied On September 19, 2016 12:36 PM UTC

Hi Sharad,  
Thank you for updating us. 
We regret to let you know that currently we don’t have support to set external workbook range to a chart series. However, we have added it to our Feature request list and it will be implemented in any of our upcoming releases. 
Sridhar S 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon