ShapeCollection
ShapeCollection class
Represents all the shape in a worksheet/chart.
class ShapeCollection;
Methods
get(number)
Gets the Shape object at the specific index in the list.
get(index: number) : Shape;
Parameters:
Parameter | Type | Description |
---|---|---|
index | number | The index. |
Returns
get(string)
Gets the Shape object by the name of the shape.
get(name: string) : Shape;
Parameters:
Parameter | Type | Description |
---|---|---|
name | string | The name of the shape. |
Returns
addCopy(Shape, number, number, number, number)
Adds and copy a shape to the worksheet.
addCopy(sourceShape: Shape, topRow: number, top: number, leftColumn: number, left: number) : Shape;
Parameters:
Parameter | Type | Description |
---|---|---|
sourceShape | Shape | Source shape. |
topRow | number | The top row index. |
top | number | Represents the vertical offset from its top row, in unit of pixel. |
leftColumn | number | The left column index. |
left | number | Represents the horizontal offset from its left column, in unit of pixel. |
Returns
The new Shape object.
addCheckBox(number, number, number, number, number, number)
Adds a checkbox to the worksheet.
addCheckBox(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : CheckBox;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of checkbox from its top row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of textbox from its left column, in unit of pixel. |
height | number | Height of textbox, in unit of pixel. |
width | number | Width of textbox, in unit of pixel. |
Returns
The new CheckBox object index.
addTextBox(number, number, number, number, number, number)
Adds a text box to the worksheet.
addTextBox(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : TextBox;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of textbox from its top row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of textbox from its left column, in unit of pixel. |
height | number | Represents the height of textbox, in unit of pixel. |
width | number | Represents the width of textbox, in unit of pixel. |
Returns
A TextBox object.
addEquation(number, number, number, number, number, number)
Add an equation object to the worksheet.
addEquation(topRow: number, top: number, leftColumn: number, left: number, height: number, width: number) : TextBox;
Parameters:
Parameter | Type | Description |
---|---|---|
topRow | number | The top row index. |
top | number | The vertical offset its top row, in unit of pixel. |
leftColumn | number | The left column index. |
left | number | The horizontal offset from its left column, in unit of pixel. |
height | number | The height of equation, in unit of pixel. |
width | number | The width of equation, in unit of pixel. |
Returns
addSpinner(number, number, number, number, number, number)
Adds a Spinner to the worksheet.
addSpinner(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : Spinner;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of Spinner from its left row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of Spinner from its left column, in unit of pixel. |
height | number | Represents the height of Spinner, in unit of pixel. |
width | number | Represents the width of Spinner, in unit of pixel. |
Returns
A Spinner object.
addScrollBar(number, number, number, number, number, number)
Adds a ScrollBar to the worksheet.
addScrollBar(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : ScrollBar;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of ScrollBar from its left row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of ScrollBar from its left column, in unit of pixel. |
height | number | Represents the height of ScrollBar, in unit of pixel. |
width | number | Represents the width of ScrollBar, in unit of pixel. |
Returns
A ScrollBar object.
addRadioButton(number, number, number, number, number, number)
Adds a RadioButton to the worksheet.
addRadioButton(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : RadioButton;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of RadioButton from its left row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of RadioButton from its left column, in unit of pixel. |
height | number | Represents the height of RadioButton, in unit of pixel. |
width | number | Represents the width of RadioButton, in unit of pixel. |
Returns
A RadioButton object.
addListBox(number, number, number, number, number, number)
Adds a ListBox to the worksheet.
addListBox(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : ListBox;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of ListBox from its left row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of ListBox from its left column, in unit of pixel. |
height | number | Represents the height of ListBox, in unit of pixel. |
width | number | Represents the width of ListBox, in unit of pixel. |
Returns
A ListBox object.
addComboBox(number, number, number, number, number, number)
Adds a ComboBox to the worksheet.
addComboBox(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : ComboBox;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of ComboBox from its left row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of ComboBox from its left column, in unit of pixel. |
height | number | Represents the height of ComboBox, in unit of pixel. |
width | number | Represents the width of ComboBox, in unit of pixel. |
Returns
A ComboBox object.
addGroupBox(number, number, number, number, number, number)
Adds a GroupBox to the worksheet.
addGroupBox(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : GroupBox;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of GroupBox from its left row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of GroupBox from its left column, in unit of pixel. |
height | number | Represents the height of GroupBox, in unit of pixel. |
width | number | Represents the width of GroupBox, in unit of pixel. |
Returns
A GroupBox object.
addButton(number, number, number, number, number, number)
Adds a Button to the worksheet.
addButton(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : Button;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of Button from its left row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of Button from its left column, in unit of pixel. |
height | number | Represents the height of Button, in unit of pixel. |
width | number | Represents the width of Button, in unit of pixel. |
Returns
A Button object.
addLabel(number, number, number, number, number, number)
Adds a Label to the worksheet.
addLabel(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : Label;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of Label from its left row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of Label from its left column, in unit of pixel. |
height | number | Represents the height of Label, in unit of pixel. |
width | number | Represents the width of Label, in unit of pixel. |
Returns
A Label object.
addLabelInChart(number, number, number, number)
Adds a label to the chart.
addLabelInChart(top: number, left: number, height: number, width: number) : Label;
Parameters:
Parameter | Type | Description |
---|---|---|
top | number | Represents the vertical offset of label from the upper left corner in units of 1/4000 of the chart area. |
left | number | Represents the vertical offset of label from the upper left corner in units of 1/4000 of the chart area. |
height | number | Represents the height of label, in units of 1/4000 of the chart area. |
width | number | Represents the width of label, in units of 1/4000 of the chart area. |
Returns
A new Label object.
addTextBoxInChart(number, number, number, number)
Adds a textbox to the chart.
addTextBoxInChart(top: number, left: number, height: number, width: number) : TextBox;
Parameters:
Parameter | Type | Description |
---|---|---|
top | number | Represents the vertical offset of textbox from the upper left corner in units of 1/4000 of the chart area. |
left | number | Represents the vertical offset of textbox from the upper left corner in units of 1/4000 of the chart area. |
height | number | Represents the height of textbox, in units of 1/4000 of the chart area. |
width | number | Represents the width of textbox, in units of 1/4000 of the chart area. |
Returns
A TextBox object.
addTextEffectInChart(MsoPresetTextEffect, string, string, number, boolean, boolean, number, number, number, number)
Inserts a WordArt object to the chart
addTextEffectInChart(effect: MsoPresetTextEffect, text: string, fontName: string, size: number, fontBold: boolean, fontItalic: boolean, top: number, left: number, height: number, width: number) : Shape;
Parameters:
Parameter | Type | Description |
---|---|---|
effect | MsoPresetTextEffect | The mso preset text effect type. |
text | string | The WordArt text. |
fontName | string | The font name. |
size | number | The font size |
fontBold | boolean | Indicates whether font is bold. |
fontItalic | boolean | Indicates whether font is italic. |
top | number | Represents the vertical offset of shape from the upper left corner in units of 1/4000 of the chart area. |
left | number | Represents the vertical offset of shape from the upper left corner in units of 1/4000 of the chart area. |
height | number | Represents the height of shape, in units of 1/4000 of the chart area. |
width | number | Represents the width of shape, in units of 1/4000 of the chart area. |
Returns
Returns a Shape object that represents the new WordArt object.
addTextEffect(MsoPresetTextEffect, string, string, number, boolean, boolean, number, number, number, number, number, number)
Inserts a WordArt object.
addTextEffect(effect: MsoPresetTextEffect, text: string, fontName: string, size: number, fontBold: boolean, fontItalic: boolean, upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : Shape;
Parameters:
Parameter | Type | Description |
---|---|---|
effect | MsoPresetTextEffect | The mso preset text effect type. |
text | string | The WordArt text. |
fontName | string | The font name. |
size | number | The font size |
fontBold | boolean | Indicates whether font is bold. |
fontItalic | boolean | Indicates whether font is italic. |
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of shape from its left row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of shape from its left column, in unit of pixel. |
height | number | Represents the height of shape, in unit of pixel. |
width | number | Represents the width of shape, in unit of pixel. |
Returns
Returns a Shape object that represents the new WordArt object.
addWordArt(PresetWordArtStyle, string, number, number, number, number, number, number)
Adds preset WordArt since Excel 2007.s
addWordArt(style: PresetWordArtStyle, text: string, upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : Shape;
Parameters:
Parameter | Type | Description |
---|---|---|
style | PresetWordArtStyle | The preset WordArt Style. |
text | string | The text. |
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of shape from its left row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of shape from its left column, in unit of pixel. |
height | number | Represents the height of shape, in unit of pixel. |
width | number | Represents the width of shape, in unit of pixel. |
Returns
addRectangle(number, number, number, number, number, number)
Adds a RectangleShape to the worksheet.
addRectangle(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : RectangleShape;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of RectangleShape from its left row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of RectangleShape from its left column, in unit of pixel. |
height | number | Represents the height of RectangleShape, in unit of pixel. |
width | number | Represents the width of RectangleShape, in unit of pixel. |
Returns
A RectangleShape object.
addOval(number, number, number, number, number, number)
Adds a Oval to the worksheet.
addOval(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : Oval;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of Oval from its left row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of Oval from its left column, in unit of pixel. |
height | number | Represents the height of Oval, in unit of pixel. |
width | number | Represents the width of Oval, in unit of pixel. |
Returns
A Oval object.
addLine(number, number, number, number, number, number)
Adds a LineShape to the worksheet.
addLine(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : LineShape;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of LineShape from its left row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of LineShape from its left column, in unit of pixel. |
height | number | Represents the height of LineShape, in unit of pixel. |
width | number | Represents the width of LineShape, in unit of pixel. |
Returns
A LineShape object.
addFreeFloatingShape(MsoDrawingType, number, number, number, number, Uint8Array, boolean)
Adds a free floating shape to the worksheet.Only applies for line/image shape.
addFreeFloatingShape(type: MsoDrawingType, top: number, left: number, height: number, width: number, imageData: Uint8Array, isOriginalSize: boolean) : Shape;
Parameters:
Parameter | Type | Description |
---|---|---|
type | MsoDrawingType | The shape type. |
top | number | Represents the vertical offset of shape from the worksheet’s top row, in unit of pixel. |
left | number | Represents the horizontal offset of shape from the worksheet’s left column, in unit of pixel. |
height | number | Represents the height of LineShape, in unit of pixel. |
width | number | Represents the width of LineShape, in unit of pixel. |
imageData | number[] | The image data,only applies for the picture. |
isOriginalSize | boolean | Whether the shape use original size if the shape is image. |
Returns
addShapeInChart(MsoDrawingType, PlacementType, number, number, number, number, Uint8Array)
Add a shape to chart .All unit is 1/4000 of chart area.
addShapeInChart(type: MsoDrawingType, placement: PlacementType, left: number, top: number, right: number, bottom: number, imageData: Uint8Array) : Shape;
Parameters:
Parameter | Type | Description |
---|---|---|
type | MsoDrawingType | The drawing type. |
placement | PlacementType | the placement type. |
left | number | In unit of 1/4000 chart area width. |
top | number | In unit of 1/4000 chart area height. |
right | number | In unit of 1/4000 chart area width. |
bottom | number | In unit of 1/4000 chart area height. |
imageData | number[] | If the shape is not a picture or ole object,imageData should be null. |
Returns
addShapeInChart(MsoDrawingType, PlacementType, number, number, number, number)
Add a shape to chart .All unit is 1/4000 of chart area.
addShapeInChart(type: MsoDrawingType, placement: PlacementType, left: number, top: number, right: number, bottom: number) : Shape;
Parameters:
Parameter | Type | Description |
---|---|---|
type | MsoDrawingType | The drawing type. |
placement | PlacementType | the placement type. |
left | number | In unit of 1/4000 chart area width. |
top | number | In unit of 1/4000 chart area height. |
right | number | In unit of 1/4000 chart area width. |
bottom | number | In unit of 1/4000 chart area height. |
Returns
addShapeInChartByScale(MsoDrawingType, PlacementType, number, number, number, number)
Add a shape to chart. All unit is percent scale of chart area.
addShapeInChartByScale(type: MsoDrawingType, placement: PlacementType, left: number, top: number, right: number, bottom: number) : Shape;
Parameters:
Parameter | Type | Description |
---|---|---|
type | MsoDrawingType | The drawing type. |
placement | PlacementType | the placement type. |
left | number | Unit is percent scale of chart area width. |
top | number | Unit is percent scale of chart area height. |
right | number | Unit is percent scale of chart area width. |
bottom | number | Unit is percent scale of chart area height. |
Returns
addShapeInChartByScale(MsoDrawingType, PlacementType, number, number, number, number, Uint8Array)
Add a shape to chart .All unit is 1/4000 of chart area.
addShapeInChartByScale(type: MsoDrawingType, placement: PlacementType, left: number, top: number, right: number, bottom: number, imageData: Uint8Array) : Shape;
Parameters:
Parameter | Type | Description |
---|---|---|
type | MsoDrawingType | The drawing type. |
placement | PlacementType | the placement type. |
left | number | Unit is percent scale of chart area width. |
top | number | Unit is percent scale of chart area height. |
right | number | Unit is percent scale of chart area width. |
bottom | number | Unit is percent scale of chart area height. |
imageData | number[] | If the shape is not a picture or ole object,imageData should be null. |
Returns
addArc(number, number, number, number, number, number)
Adds a ArcShape to the worksheet.
addArc(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : ArcShape;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of ArcShape from its left row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of ArcShape from its left column, in unit of pixel. |
height | number | Represents the height of ArcShape, in unit of pixel. |
width | number | Represents the width of ArcShape, in unit of pixel. |
Returns
A ArcShape object.
addShape(MsoDrawingType, number, number, number, number, number, number)
Adds a Shape to the worksheet.
addShape(type: MsoDrawingType, upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : Shape;
Parameters:
Parameter | Type | Description |
---|---|---|
type | MsoDrawingType | Mso drawing type. |
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of Shape from its left row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of Shape from its left column, in unit of pixel. |
height | number | Represents the height of Shape, in unit of pixel. |
width | number | Represents the width of Shape, in unit of pixel. |
Returns
A Shape object.
Remarks
The type could not be Chart/Comment/Picture/OleObject/Polygon/DialogBox
addAutoShape(AutoShapeType, number, number, number, number, number, number)
Adds a AutoShape to the worksheet.
addAutoShape(type: AutoShapeType, upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : Shape;
Parameters:
Parameter | Type | Description |
---|---|---|
type | AutoShapeType | Auto shape type. |
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of Shape from its left row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of Shape from its left column, in unit of pixel. |
height | number | Represents the height of Shape, in unit of pixel. |
width | number | Represents the width of Shape, in unit of pixel. |
Returns
A Shape object.
Remarks
The type could not be Chart/Comment/Picture/OleObject/Polygon/DialogBox
addAutoShapeInChart(AutoShapeType, number, number, number, number)
Adds a AutoShape to the chart.
addAutoShapeInChart(type: AutoShapeType, top: number, left: number, height: number, width: number) : Shape;
Parameters:
Parameter | Type | Description |
---|---|---|
type | AutoShapeType | Auto shape type. |
top | number | Represents the vertical offset of textbox from the upper left corner in units of 1/4000 of the chart area. |
left | number | Represents the vertical offset of textbox from the upper left corner in units of 1/4000 of the chart area. |
height | number | Represents the height of textbox, in units of 1/4000 of the chart area. |
width | number | Represents the width of textbox, in units of 1/4000 of the chart area. |
Returns
Returns a shape object.
Remarks
The type could not be Chart/Comment/Picture/OleObject/Polygon/DialogBox
addActiveXControl(ControlType, number, number, number, number, number, number)
Creates an Activex Control.
addActiveXControl(type: ControlType, topRow: number, top: number, leftColumn: number, left: number, width: number, height: number) : Shape;
Parameters:
Parameter | Type | Description |
---|---|---|
type | ControlType | The type of the control. |
topRow | number | Upper left row index. |
top | number | Represents the vertical offset of Shape from its left row, in unit of pixel. |
leftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of Shape from its left column, in unit of pixel. |
width | number | Represents the width of Shape, in unit of pixel. |
height | number | Represents the height of Shape, in unit of pixel. |
Returns
addPicture(number, number, number, number, Uint8Array)
Adds a picture to the collection.
addPicture(upperLeftRow: number, upperLeftColumn: number, lowerRightRow: number, lowerRightColumn: number, stream: Uint8Array) : Picture;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
upperLeftColumn | number | Upper left column index. |
lowerRightRow | number | Lower right row index |
lowerRightColumn | number | Lower right column index |
stream | Uint8Array | Stream object which contains the image data. |
Returns
Picture Picture object.
addPicture(number, number, Uint8Array, number, number)
Adds a picture to the collection.
addPicture(upperLeftRow: number, upperLeftColumn: number, stream: Uint8Array, widthScale: number, heightScale: number) : Picture;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
upperLeftColumn | number | Upper left column index. |
stream | Uint8Array | Stream object which contains the image data. |
widthScale | number | Scale of image width, a percentage. |
heightScale | number | Scale of image height, a percentage. |
Returns
Picture Picture object.
addSvg(number, number, number, number, number, number, Uint8Array, Uint8Array)
Adds svg image.
addSvg(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number, svgData: Uint8Array, compatibleImageData: Uint8Array) : Picture;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of shape from its left row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | The horizontal offset of shape from its left column, in unit of pixel. |
height | number | The height of shape, in unit of pixel. |
width | number | The width of shape, in unit of pixel. |
svgData | number[] | The svg image data. |
compatibleImageData | number[] | Converted image data from svg in order to be compatible with Excel 2016 or lower versions. |
Returns
addIcons(number, number, number, number, number, number, Uint8Array, Uint8Array)
Adds svg image.
addIcons(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number, imageByteData: Uint8Array, compatibleImageData: Uint8Array) : Picture;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of shape from its left row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | The horizontal offset of shape from its left column, in unit of pixel. |
height | number | The height of shape, in unit of pixel. |
width | number | The width of shape, in unit of pixel. |
imageByteData | number[] | The image byte data. |
compatibleImageData | number[] | Converted image data from svg in order to be compatible with Excel 2016 or lower versions. |
Returns
addLinkedPicture(number, number, number, number, string)
Add a linked picture.
addLinkedPicture(upperLeftRow: number, upperLeftColumn: number, height: number, width: number, sourceFullName: string) : Picture;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
upperLeftColumn | number | Upper left column index. |
height | number | The height of the shape. In unit of pixels |
width | number | The width of the shape. In unit of pixels |
sourceFullName | string | The path and name of the source file for the linked image |
Returns
Picture Picture object.
addOleObjectWithLinkedImage(number, number, number, number, string)
Add a linked picture.
addOleObjectWithLinkedImage(upperLeftRow: number, upperLeftColumn: number, height: number, width: number, sourceFullName: string) : OleObject;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
upperLeftColumn | number | Upper left column index. |
height | number | The height of the shape. In unit of pixels |
width | number | The width of the shape. In unit of pixels |
sourceFullName | string | The path and name of the source file for the linked image |
Returns
Picture Picture object.
addPictureInChart(number, number, Uint8Array, number, number)
Adds a picture to the chart.
addPictureInChart(top: number, left: number, stream: Uint8Array, widthScale: number, heightScale: number) : Picture;
Parameters:
Parameter | Type | Description |
---|---|---|
top | number | Represents the vertical offset of shape from the upper left corner in units of 1/4000 of the chart area. |
left | number | Represents the horizontal offset of shape from the upper left corner in units of 1/4000 of the chart area. |
stream | Uint8Array | Stream object which contains the image data. |
widthScale | number | Scale of image width, a percentage. |
heightScale | number | Scale of image height, a percentage. |
Returns
Returns a Picture object.
addOleObject(number, number, number, number, number, number, Uint8Array)
Adds an OleObject.
addOleObject(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number, imageData: Uint8Array) : OleObject;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | |
top | number | |
upperLeftColumn | number | |
left | number | |
height | number | |
width | number | |
imageData | number[] |
Returns
copyCommentsInRange(ShapeCollection, CellArea, number, number)
Copy all comments in the range.
copyCommentsInRange(shapes: ShapeCollection, ca: CellArea, destRow: number, destColumn: number) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
shapes | ShapeCollection | The source shapes. |
ca | CellArea | The source range. |
destRow | number | The dest range start row. |
destColumn | number | The dest range start column. |
copyInRange(ShapeCollection, CellArea, number, number, boolean)
Copy shapes in the range to destination range.
copyInRange(sourceShapes: ShapeCollection, ca: CellArea, destRow: number, destColumn: number, isContained: boolean) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
sourceShapes | ShapeCollection | Source shapes. |
ca | CellArea | The source range. |
destRow | number | The dest row index of the dest range. |
destColumn | number | The dest column of the dest range. |
isContained | boolean | Whether only copy the shapes which are contained in the range. /// If true,only copies the shapes in the range. /// Otherwise,it works as MS Office. |
deleteInRange(CellArea)
Delete shapes in the range.Comment shapes will not be deleted.
deleteInRange(ca: CellArea) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
ca | CellArea | The range.If the shapes are contained in the range, they will be removed. |
deleteShape(Shape)
Delete a shape. If the shape is in the group or is a comment shape, it will not be deleted.
deleteShape(shape: Shape) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
shape | Shape |
group(Shape[])
Group the shapes.
group(groupItems: Shape[]) : GroupShape;
Parameters:
Parameter | Type | Description |
---|---|---|
groupItems | Shape[] | the group items. |
Returns
Return the group shape.
Remarks
The shape in the groupItems should not be grouped. The shape must be in this Shapes collection.
ungroup(GroupShape)
Ungroups the shape items.
ungroup(group: GroupShape) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
group | GroupShape | The group shape. |
Remarks
If the group shape is grouped by another group shape,nothing will be done.
removeAt(number)
Remove the shape.
removeAt(index: number) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
index | number | The index of the shape. |
remove(Shape)
Remove the shape.
remove(shape: Shape) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
shape | Shape |
clear()
Clear all shapes in the worksheet.
clear() : void;
updateSelectedValue()
Update the selected value by the value of the linked cell or range of the shape.
updateSelectedValue() : void;
addFreeform(number, number, number, number, number, number, ShapePath[])
Adds a freeform shape to the worksheet.
addFreeform(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number, paths: ShapePath[]) : Shape;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
top | number | Represents the vertical offset of freeform shape from its left row, in unit of pixel. |
upperLeftColumn | number | Upper left column index. |
left | number | Represents the horizontal offset of freeform shape from its left column, in unit of pixel. |
height | number | Represents the height of freeform shape, in unit of pixel. |
width | number | Represents the width of freeform shape, in unit of pixel. |
paths | ShapePath[] | Represents a user-defined path |
Returns
A freeform shape.
Remarks
Notice: That the width and height in the parameters can be any positive integer values, not the total width and height of the ShapePath array specified by ’paths’. The relationship between them is a scale-fill relationship, that is, each ShapePath object will be scaled according to the width and height. Therefore, when there are multiple objects in the ‘paths’, each ShapePath object needs to be designed reasonably to meet expectations. When there is only one ShapePath object and there are no other requirements, passing the object’s width and height as parameter values is a good solution.
addSignatureLine(number, number, SignatureLine)
Adds a Signature Line to the worksheet.
addSignatureLine(upperLeftRow: number, upperLeftColumn: number, signatureLine: SignatureLine) : Picture;
Parameters:
Parameter | Type | Description |
---|---|---|
upperLeftRow | number | Upper left row index. |
upperLeftColumn | number | Upper left column index. |
signatureLine | SignatureLine | Represents a signature line object. |
Returns
getCount()
@deprecated. Please use the ‘count’ property instead. Gets the number of elements contained in.
getCount() : number;
isNull()
Checks whether the implementation object is null.
isNull() : boolean;