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. Image for the cookie policy date

How to set horizontal axis label is not set

Hi,

How to set horizontal axis label for chart 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];

object[] Xvalues = new object[] {"=Sheet1!$A$1:$A$10"}
IChart ochart = oshhet.Charts.Add();
IChartSerie oserie = ochart.Series.Add(ExcelchartType ......);
oserie.EnteredDirectlyCategoryLabel = Xvalues;

My horizontal label value is not set with column range value .
Excel file is attach with mail.

Thanks
sharad kumar

Attachment: New_folder_(6)_8ba28a11.rar

1 Reply

SS Sridhar Sukumar Syncfusion Team September 12, 2016 12:18 PM UTC

Hi Sharad, 
 
Thank you for contacting Syncfusion support. 
 
EnteredDirectlyCategoryLabel property is used to set string value to the chart series category labels. If you want to set the range value to category label, then kindly use the following code example. 
 
Code example: 
chart.Series[0].CategoryLabels = worksheet.Range["A1:A10"]; 
 
We have prepared a sample for your requirement which can be downloaded from the following link 
 
 
 
Please let us know if you have any concerns on this. 
 
Regards. 
Sridhar S 
 


Loader.
Live Chat Icon For mobile
Up arrow icon