1
votes

I know how to create a shape and how we can fill color or adjust it's dimensions. But when the shape size is small eg 16x16 the outline of the same overlap the foreground color. How we can remove this default outline or change color in office.js API. I can't find this in documentation given https://docs.microsoft.com/en-us/javascript/api/excel/excel.shape?view=excel-js-preview.

If not possible is there any alternative?

Thanks in advance.

1

1 Answers

2
votes

You can use lineFormat to change the color of the outline.

  shapes.getItemAt(i).lineFormat.transparency = 1;
  shapes.getItemAt(i).fill.clear();

I create a gist for you: https://gist.github.com/lumine2008/604300d1c0c0a130279cb52fa41a2470

Here is the document https://docs.microsoft.com/en-us/javascript/api/excel/excel.shapelineformat?view=excel-js-preview