How to change RectangularCallout shape's tip

In below sample code i want to change a tip for RectangularCallout but it is not working
how to change a tip point for this shape

Shape polygonShape = worksheet.Shapes.AddAutoShape(AutoShapeType.RectangularCallout, 0, 0, 0, 0, 0, 0);
polygonShape.Placement = PlacementType.MoveAndSize; //Set the placement type as the Shapes will move and resize with cells.
polygonShape.X = (int)((xx1 + chartX)); //Shape Left properties
polygonShape.Y = (int)(Top + chartYPosition); //Shape Top properties
polygonShape.WidthPt = chartWidth * InPoints; // Shape Width
polygonShape.HeightPt = (((double.Parse(taskHeight) * InPoints) / (double.Parse(rowHeight.ToString()) * InPoints)) * rowHightMain); // Shape Height

if (polygonTextSize > 0)
{
				polygonTextSize = (polygonTextSize < 1) ? 1 : polygonTextSize;
				// Set the shape's text
				polygonShape.Text = fnote;

				// Apply uniform font size and color
				foreach (TextParagraph para in polygonShape.TextBody.TextParagraphs)
				{
								para.Font.Name = "Meiryo UI";
								para.Font.DoubleSize = (polygonTextSize * InPoints);
								//para.Font.Name = fontFamily;
								//para.Font.DoubleSize = polygonTextSize;
								para.Font.Color = ColorTranslator.FromOle(ffontcolor); // Set the font color
				}
}

// Set the text wrap mode 
polygonShape.IsTextWrapped = false;

// Set outside width text which is not visible
polygonShape.TextHorizontalOverflow = TextOverflowType.Clip;
polygonShape.TextVerticalOverflow = TextOverflowType.Clip;

polygonShape.Fill.FillType = FillType.Solid; //Set the polygon fill type
polygonShape.Fill.SolidFill.Color = ColorTranslator.FromOle(polygonColor); //Set the polygon fill color
polygonShape.Line.FillType = FillType.Solid; //Set the polygon fill type
polygonShape.Line.SolidFill.Color = ColorTranslator.FromOle(fframecolor); // Set the polygon line color

SetCommentShapeAlignment(polygonShape, ftextalign, ftextleftright, ftextuprlwr, InPoints);

if (fbackstyle == "1")
{
				polygonShape.Fill.FillType = FillType.None;
				//polygonShape.Fill.FillType = FillType.None;
}
if (fframestyle_bor == "1")
{
				//polygonShape.Line.Transparency = 1.0F;
				polygonShape.Line.FillType = FillType.None;
}

// Calculate X adjustment (same logic as Interop)
double fpointday_px = (long.Parse(fpointday) - printStartDate) * fx;
double assignment_X_Value = 1 / chartWidth;
double diff_fpoint_to_task = fpointday_px - chartX;
double actual_position_x = diff_fpoint_to_task * assignment_X_Value;
actual_position_x = actual_position_x + (-0.5);

// Calculate Y adjustment (same logic as Interop)
double YLinkTipPosition = (Top + chartYlinktip);
double diff_px = YLinkTipPosition - polygonShape.Y;
double assignment_Y_Value = 1.0 / polygonShape.Height;
double actual_position_y = diff_px * assignment_Y_Value;
actual_position_y = actual_position_y + (-0.5);

// Get the shape's geometry adjustment guides
ShapeGuideCollection shapeGuides = polygonShape.Geometry.ShapeAdjustValues;

// Apply adjustments (Aspose uses "adj1", "adj2", etc.)
shapeGuides.Clear(); // Clear existing adjustments (if any)
shapeGuides.Add("adj1", actual_position_x); // X position adjustment
shapeGuides.Add("adj2", actual_position_y); // Y position adjustment

// Optional: Add more adjustments if needed (e.g., for connectors)
shapeGuides.Add("adj3", 0.16667d); // Example for a 3rd adjustment

@tejas.patel

Cause

To change the tip point of a RectangularCallout shape in Aspose.Cells, you need to adjust the shape’s geometry properties. The adjustments are typically made using the ShapeGuideCollection, which allows you to set specific parameters for the shape’s appearance.

Solution

In your code, you are already using the ShapeGuideCollection to apply adjustments. However, ensure that you are using the correct adjustment keys for the tip position. The typical keys for adjusting the tip of a callout shape are usually named adj1, adj2, etc. Verify the specific adjustments required for the RectangularCallout.

Code

Here’s a refined version of your code snippet to adjust the tip of the RectangularCallout:

// Calculate X and Y adjustments for the tip position
double tipXAdjustment = actual_position_x; // Your calculated X adjustment
double tipYAdjustment = actual_position_y; // Your calculated Y adjustment

// Get the shape's geometry adjustment guides
ShapeGuideCollection shapeGuides = polygonShape.Geometry.ShapeAdjustValues;

// Clear existing adjustments
shapeGuides.Clear(); 

// Apply adjustments for the tip position
shapeGuides.Add("adj1", tipXAdjustment); // X position adjustment for the tip
shapeGuides.Add("adj2", tipYAdjustment); // Y position adjustment for the tip

// Optionally, add more adjustments if needed
shapeGuides.Add("adj3", 0.16667d); // Example for a 3rd adjustment

Ensure that the values you are calculating for actual_position_x and actual_position_y are correct and correspond to the desired tip position.

Next Steps

  1. Verify the adjustments you are applying to ensure they correspond to the correct shape properties.
  2. Test the adjustments to see if they affect the shape’s tip as expected.
  3. If the tip still does not change, consult the Aspose.Cells documentation for any specific requirements regarding callout shapes.

If you have any further questions or need additional assistance, feel free to ask!

@tejas.patel
All adjustment points are adjusted in Shape.Geometry.ShapeAdjustValues. By default, there are no values in it, so they need to be added using Shape.Geometry.ShapeAdjustValues.Add(string, double) method. If there are any, the original values need to be overwritten. Only one adjustment point is adjusted based on the key value “adj”, and multiple adjustment values are adjusted using “adj1”, “adj2”… and so on. Here, the Rectangular Callout shape only has one adjustment point, so add the “adj” parameter and value directly.

Please refer to the following example code to adjust the moving point.

// Get the shape's geometry adjustment guides
ShapeGuideCollection shapeGuides = polygonShape.Geometry.ShapeAdjustValues;

// Apply adjustments 
shapeGuides.Clear(); // Clear existing adjustments (if any)

// adjust the moving point, Value needs to be less than 1
shapeGuides.Add("adj", 0.16667d); 

If you still have questions, please provide complete executable sample code and expected result file, and we will check them soon.