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

X axis labels on graph using Syncfusion.XlsIO

Thread ID:





131232 Jun 29,2017 10:17 PM UTC Jul 3,2017 09:12 AM UTC ASP.NET Web Forms 3
Tags: XlsIO
Robert Pouleijn
Asked On June 29, 2017 10:17 PM UTC

I have the following code to add a graph to an Excel object created with Syncfusion.XlsIO. But I don't see any labels on the Horizontal(X) axis. How do I control the labels on the axis? 

Many thx!

      var chart = _worksheet.Charts.Add();
      chart.TopRow = toprow;
      chart.BottomRow = toprow + 25;
      chart.RightColumn = 15;
      chart.ChartTitle = "Project cash-flow";
      chart.ChartType = ExcelChartType.Line;

      var productA = chart.Series.Add("Cumulatief grond cash-flow");
      productA.Values = _worksheet.Range[row, 2, row, column];
      productA.CategoryLabels = _worksheet.Range[1, 2, 1, column];
      productA.SerieFormat.LineProperties.LineColor = Color.DarkBlue;

      //Set second serie
      var productB = chart.Series.Add("Cumulatief opstal cash-flow");
      productB.Values = _worksheet.Range[++row, 2, row, column];
      productB.CategoryLabels = _worksheet.Range[1, 2, 1, column];
      productB.SerieFormat.LineProperties.LineColor = Color.Red;

      var productC = chart.Series.Add("Totaal");
      productC.Values = _worksheet.Range[++row, 2, row, column];
      productC.CategoryLabels = _worksheet.Range[1, 2, 1, column];
      productC.SerieFormat.LineProperties.LineColor = Color.Green;

Mathu Mohan Vijayakumar [Syncfusion]
Replied On June 30, 2017 08:38 AM UTC

Hi Robert, 
We are unable to reproduce the reported issue from our side. We suspect that axis labels are hidden due to the TickLabelPosition of category axis set to none (or) Empty string values has been set for category axis. We have prepared the simple sample to demonstrate the possible chances for hidden Axis labels and this sample can be downloaded from the following link.  
We have shared below the code example to change the axis labels visibility by the TickLabelPosition  property. 
//Chart category axis tick label position 
chart.PrimaryCategoryAxis.TickLabelPosition = ExcelTickLabelPosition.TickLabelPosition_NextToAxis; 
Sample link:   
If your issue is different from these scenarios, kindly modify the sample to reproduce the issue and share us the modified sample along with the issue reproducing input files which will be helpful for us to give you a prompt solution at the earliest. 
Mathu Mohan V A 

Robert Pouleijn
Replied On June 30, 2017 09:33 AM UTC

Hi Mathu,

U are so right, the series was pointing to empty cell values :(

Sorry to have bothered u!


Sridhar Sukumar [Syncfusion]
Replied On July 3, 2017 09:12 AM UTC

Hi Robert, 
Thank you for updating us. 
We are glad that the issue is resolved at your end. Please let us know if you need any further assistance. 


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

or the page will be automatically redirected to 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