Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Sat Jan 18, 2020 4:54 am

I am using 'Callout: Down Arrow 1' shape using spire xls,
can we change its arrow size using spire xls?
I want it like this:
Attachments
Capture 1.PNG
Capture 1.PNG (6.24 KiB) Viewed 2130 times

aksh0614
 
Posts: 23
Joined: Mon Jul 02, 2018 3:53 am

Sun Jan 19, 2020 6:14 am

Hello,

Thanks for your inquiry.
Sorry our Spire.XLS doesn't support directly changing the arrow size for DownArrowCallout shape at present. We are considering adding it as a new feature into our upgrade list. If it can be achieved in the future, I will inform you. As a temporary workaround, you can combine several shapes together like the following code to achieve the similar effect. The attachment is my output for your reference.
Code: Select all
//Instantiate a workbook object
Workbook workbook = new Workbook();
//Get the first worksheet
Worksheet sheet = workbook.Worksheets[0];

//Add a rectangle
IPrstGeomShape rect = sheet.PrstGeomShapes.AddPrstGeomShape(10, 2, 300, 200, PrstGeomShapeType.Rect);
rect.Left = 20;
rect.Top = 20;     

//Add a line
IPrstGeomShape line = sheet.PrstGeomShapes.AddPrstGeomShape(10, 2, 1, 70, PrstGeomShapeType.Line);
line.Left = rect.Left + rect.Width / 2;
line.Top = rect.Top + rect.Height;

//Add a triangle
IPrstGeomShape triangle = sheet.PrstGeomShapes.AddPrstGeomShape(10, 2, 40, 30, PrstGeomShapeType.Triangle);
triangle.Rotation = 180;
triangle.Left = rect.Left + rect.Width / 2 - triangle.Width / 2;
triangle.Top = rect.Top + rect.Height + line.Height;

//Save the file
workbook.SaveToFile("AddShapes.xlsx", ExcelVersion.Version2013);

Sincerely,
Rachel
E-iceblue support team
Attachments
attachment.zip
(5.91 KiB) Downloaded 474 times
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Sat Oct 12, 2024 7:07 am

Hello,

Thank you for your patience.
Our latest version (Spire.XLS Pack(Hotfix) Version:14.9.5) supports directly changing the arrow size for DownArrowCallout shape. Please download the latest version from the links below and test it with the sample code. If you have any other questions, please feel free to contact.
Website download link: https://www.e-iceblue.com/Download/download-excel-for-net-now.html
Nuget download link: https://www.nuget.org/packages/Spire.XLS/14.9.5
Code: Select all
        //Sample code
        Workbook workbook = new Workbook();
        Worksheet sheet = workbook.Worksheets[0];
        IPrstGeomShape prstGeomShape = sheet.PrstGeomShapes.AddPrstGeomShape(10, 12, 200, 200, PrstGeomShapeType.DownArrowCallout);
        XlsPrstGeomShape xlsPrstGeomShape = (XlsPrstGeomShape)prstGeomShape;
        GeomertyAdjustValue geomertyAdjustValuel = xlsPrstGeomShape.ShapeAdjustValues.AddAdjustValue(GeomertyAdjustValueFormulaType.LiteralValue);
        geomertyAdjustValuel.SetFormulaParameter(10);
        GeomertyAdjustValue geomertyAdjustValue2 = xlsPrstGeomShape.ShapeAdjustValues.AddAdjustValue(GeomertyAdjustValueFormulaType.LiteralValue);
        geomertyAdjustValue2.SetFormulaParameter(20);
        GeomertyAdjustValue geomertyAdjustValue3 = xlsPrstGeomShape.ShapeAdjustValues.AddAdjustValue(GeomertyAdjustValueFormulaType.LiteralValue);
        geomertyAdjustValue3.SetFormulaParameter(25);
        GeomertyAdjustValue geomertyAdjustValue4 = xlsPrstGeomShape.ShapeAdjustValues.AddAdjustValue(GeomertyAdjustValueFormulaType.LiteralValue);
        geomertyAdjustValue4.SetFormulaParameter(50);
        workbook.SaveToFile("AddShapes.xlsx", ExcelVersion.Version2013);

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1271
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.XLS