Get Started
Usage API
More information

GetAllCharts

GetAllCharts() → { Array.<ApiChart> }

Returns an array with all the chart objects from the slide layout.

Parameters:

This method doesn't have any parameters.

Returns:

Type
Array.<ApiChart>

Example

Copy code
builder.CreateFile("pptx");
var oPresentation = Api.GetPresentation();
var oSlide = oPresentation.GetSlideByIndex(0);
oSlide.RemoveAllObjects();
var oMaster = oPresentation.GetMaster(0);
var oLayout = oMaster.GetLayout(0);
var oChart = Api.CreateChart("bar3D", [
    [200, 240, 280],
    [250, 260, 280]
  ], ["Projected Revenue", "Estimated Costs"], [2014, 2015, 2016], 4051300, 2347595, 24);
oChart.SetVerAxisTitle("USD In Hundred Thousands", 10);
oChart.SetHorAxisTitle("Year", 11);
oChart.SetLegendPos("bottom");
oChart.SetShowDataLabels(false, false, true, false);
oChart.SetTitle("Financial Overview", 20);
oChart.SetSize(300 * 36000, 130 * 36000);
oChart.SetPosition(608400, 1267200);
oLayout.AddObject(oChart);
var aCharts = oLayout.GetAllCharts();
var oStroke = Api.CreateStroke(1 * 150, Api.CreateSolidFill(Api.CreateRGBColor(155, 64, 1)));
aCharts[0].SetMinorHorizontalGridlines(oStroke);
builder.SaveFile("pptx", "GetAllCharts.pptx");
builder.CloseFile();

Resulting document