Hi,
I am trying to move labels so they appear below (for negative) or above (for positive) the column’s area. It is NOT for all labels, just a specific few (the red and green areas). I use the following code (which is a method where I pass the Point as pnt variable) :
switch (posWhere)
{
case LabelPositionType.Above:
pnt.DataLabels.Y = pnt.ShapeY - pnt.DataLabels.Height - 1;
break;
case LabelPositionType.Below:
pnt.DataLabels.Y = pnt.ShapeY + pnt.ShapeHeight + 1;
break;
}
Please note that I am only changing the Y value of the label. However, the labels look as if their X values have slightly moved as well. (See attached file)
SetlabelPosition.zip (14.7 KB)
To help me debug, In column T, from row 20 onwards I printed the labels X position BEFORE I moved any of the labels, and in U I printed them again after all the work was done. The X values did not change, however the display does not seem correct.
I also made only one call to the chart’s Calculate() method - which is right before I started moving the labels, and the only action which happens to the whole sheet after the moving, is the U column for the new X positions.
Any idea where I am going wrong with this ?
I am using Aspose 20.4.0.0
Regards
Alex