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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set series value

Thread ID:

Created:

Updated:

Platform:

Replies:

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

Hi,

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.

Thanks
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, 


Kesavan 


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

Hi,

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. 
 
Regards, 
Sridhar S 


CONFIRMATION

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.

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

;