I am trying to add offset to my value axis ticklabel but it does not work.
The purpose would be to add space between the end of the curve and the ticklabels to display the end point value (datalabels) correctly: image.png (12.4 KB)
Could you have a look to this piece of code:
var pathWorkbook = @“C:\Users\hormancey\OneDrive - FactSet\Documents\TestHadrienMarker.xlsx”;
var pathWorkbookNew = @“C:\Users\hormancey\OneDrive - FactSet\Documents\TestHadrienMarkerBis.xlsx”;
var wbtest = new Workbook(pathWorkbook);
Worksheet sheettest = wbtest.Worksheets[0];
Chart charttest = sheettest.Charts[0];
//Change the color to blue for the data labels.
charttest.ValueAxis.TickLabels.Offset = 1000;
// charttest.ValueAxis.TickLabels.RotationAngle = 90;
wbtest.Save(pathWorkbookNew);
As far I know, in MS Excel, value axis labels on charts are positioned automatically, and you cannot directly set the distance between axis labels and the chart/plot area corner/end. Could you please provide a sample Excel file with a chart where the labels are positioned at your preferred offset? We will check on how to achieve this using Aspose.Cells APIs.
If I can’t set offset, do you think I can check if my datalabels intersect the axis ticklabels and move them accordingly ?
I don’t think it is possible. I don’t see any X, Y properties for the ticklabels.
Same for the Axis…
Axis tick labels and axes do not expose direct X, Y, Width and Height properties, so apparently, there is no direct way to check if the data labels overlap axis tick labels. Anyways, we will further evaluate it and get back to you.
1 Like
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.