Hello im wondering if i can insert an spreadsheet table in a document via content control. i know that you can insert charts using Api.CreateChart() like this
window.Asc.plugin.event_onDocumentContentReady = async function () {
const y_axis = mapped.map(i=>{return i.value});
const x_axis = mapped.map(i=>{return i.time});
console.log(y_axis,x_axis);
await window.Asc.plugin.executeMethod("GetAllContentControls", null, function (data) {
for (var i = 0; i < data.length; i++) {
if (data[i].Tag == "indicator") {
console.log('Found indicator:', data[i]);
var arrDocuments = [{
"Props": data[i],
"Script": `
var oParagraph = Api.CreateParagraph();
let chart = Api.CreateChart(
"bar",
[[${y_axis.join(',')}]],
["value"],
[${x_axis}],
4051300,
2347595,
24
)
oParagraph.AddDrawing(chart);
var document = Api.GetDocument();
document.InsertContent([oParagraph]);
`
}];
window.Asc.plugin.executeMethod("InsertAndReplaceContentControls", [arrDocuments]);
break;
}
}
});
};
And the result would be something like this
i want to know if its possible to do the same but in tabular form like the 2nd picture via plugins.
Obs.: both of this pictures are double clickable and open a little spreasheet to be edited
Thanks.