Get Started
Usage API
More information

GetAllCharts

GetAllCharts() → { Array.<ApiChart> }

Returns a collection of chart objects in the paragraph.

Parameters:

This method doesn't have any parameters.

Returns:

Type
Array.<ApiChart>

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
var oChart1 = Api.CreateChart("bar3D", [
  [200, 240, 280],
  [250, 260, 280]
], ["Projected Revenue", "Estimated Costs"], [2014, 2015, 2016], 4051300, 2347595, 24);
oParagraph.AddDrawing(oChart1);
var oChart2 = Api.CreateChart("bar3D", [
  [200, 240, 280],
  [250, 260, 280]
], ["Projected Revenue", "Estimated Costs"], [2014, 2015, 2016], 4051300, 2347595, 24);
oChart2.SetTitle("Financial Overview", 13);
oParagraph.AddDrawing(oChart2);
var aCharts = oParagraph.GetAllCharts();
var oStroke = Api.CreateStroke(1 * 150, Api.CreateSolidFill(Api.CreateRGBColor(155, 64, 1)));
aCharts[1].SetMinorHorizontalGridlines(oStroke);
builder.SaveFile("docx", "GetAllCharts.docx");
builder.CloseFile();

Resulting document