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

X axis labels on graph using Syncfusion.XlsIO

Thread ID:

Created:

Updated:

Platform:

Replies:

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

Hi,
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;

      //total
      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. 
  
Regards, 
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!


thx!


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


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

;