![]() ![]() ShapeCollection.addSvg also takes in a string, though this argument is XML that defines the graphic. This is either a JPEG or PNG image in string form. The ShapeCollection.addImage method takes a base64-encoded string as an argument. JPEG, PNG, and SVG images can be inserted into a worksheet as shapes. Let rectangle = shapes.addGeometricShape() of the worksheet and is 150x150 pixels. This sample creates a rectangle positioned 100 pixels from the top and left sides The following code sample creates a 150x150-pixel rectangle named "Square" that is positioned 100 pixels from the top and left sides of the worksheet. That method takes a GeometricShapeType enum as an argument. ShapeĪddGeometricShape(geometricShapeType: Excel.GeometricShapeType): Excel.ShapeĪddImage(base64ImageString: string): Excel.ShapeĪddLine(startLeft: number, startTop: number, endLeft: number, endTop: number, connectorType?: Excel.ConnectorType): Excel.ShapeĪ geometric shape is created with ShapeCollection.addGeometricShape. The following types of shapes are added using the associated method. name can be set by your add-in for easy retrieval with the ShapeCollection.getItem(name) method. These are the name and id properties, respectively. All shapes have names and IDs generated for them when they are added to the collection. Shapes are created through and stored in a worksheet's shape collection ( Worksheet.shapes). The following image shows shapes which form a thermometer. Charts are covered in their own article, Work with charts using the Excel JavaScript API. This article describes how to use geometric shapes, lines, and images in conjunction with the Shape and ShapeCollection APIs. That means anything outside of a cell is a shape. Excel defines shapes as any object that sits on the drawing layer of Excel.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |