add an image to a spreadsheet using the angular version
New DiscussionPlease help me to add an image to a spreadsheet using the angular version.
I use the code below for the JQuery version, but I didn't find equivalence for angular.
Thanks.
addChart(sheet, id, lastRow) {
let data = (document.querySelector('#' + id + ' canvas') as any).toDataURL()
let imgHeight = 16
let imgWidth = 8
let startingRow = 1 + lastRow
let endingRow = 1 + lastRow + imgHeight
let startingCol = 'A'
let endingCol = this.helpers.excel.posToAZ(imgWidth + 1)
var imageShape = new ($ as any).ig.excel.WorksheetImage(data);
imageShape.topLeftCornerCell(sheet.getCell(startingCol + startingRow));
imageShape.bottomRightCornerCell(sheet.getCell(endingCol + endingRow));
sheet.shapes().add(imageShape);
return lastRow + imgHeight
}