TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

ApiChart

new ApiChart()

Class representing a chart.

Methods

Name Description
ApplyChartStyle

Sets a style to the current chart by style ID.

GetClassType

Returns the type of the ApiChart class.

RemoveSeria

Removes the specified series from the current chart.

SetAxieNumFormat

Sets the specified numeric format to the axis values.

SetCategoryName

Sets a name to the specified chart category.

SetDataPointFill

Sets the fill to the data point in the specified chart series.

SetDataPointNumFormat

Sets the specified numeric format to the chart data point.

SetDataPointOutLine

Sets the outline to the data point in the specified chart series.

SetHorAxisLablesFontSize

Specifies font size for the labels of the horizontal axis.

SetHorAxisMajorTickMark

Specifies the major tick mark for the horizontal axis.

SetHorAxisMinorTickMark

Specifies the minor tick mark for the horizontal axis.

SetHorAxisOrientation

Specifies the horizontal axis orientation.

SetHorAxisTickLabelPosition

Spicifies tick label position for the horizontal axis.

SetHorAxisTitle

Specifies the chart horizontal axis title.

SetLegendFill

Sets the fill to the chart legend.

SetLegendFontSize

Specifies the chart legend font size.

SetLegendOutLine

Sets the outline to the chart legend.

SetLegendPos

Specifies the chart legend position.

SetMajorHorizontalGridlines

Specifies the visual properties for the major horizontal gridlines.

SetMajorVerticalGridlines

Specifies the visual properties for the major vertical gridlines.

SetMarkerFill

Sets the fill to the marker in the specified chart series.

SetMarkerOutLine

Sets the outline to the marker in the specified chart series.

SetMinorHorizontalGridlines

Specifies the visual properties for the minor horizontal gridlines.

SetMinorVerticalGridlines

Specifies the visual properties for the minor vertical gridlines.

SetPlotAreaFill

Sets the fill to the chart plot area.

SetPlotAreaOutLine

Sets the outline to the chart plot area.

SetSeriaName

Sets a name to the specified chart series.

SetSeriaNumFormat

Sets the specified numeric format to the chart series.

SetSeriaValues

Sets values to the specified chart series.

SetSeriesFill

Sets the fill to the specified chart series.

SetSeriesOutLine

Sets the outline to the specified chart series.

SetShowDataLabels

Specifies which chart data labels are shown for the chart.

SetShowPointDataLabel

Spicifies the show options for the chart data labels.

SetTitle

Specifies the chart title.

SetTitleFill

Sets the fill to the chart title.

SetTitleOutLine

Sets the outline to the chart title.

SetVerAxisOrientation

Specifies the vertical axis orientation.

SetVerAxisTitle

Specifies the chart vertical axis title.

SetVertAxisLablesFontSize

Specifies font size for the labels of the vertical axis.

SetVertAxisMajorTickMark

Specifies the major tick mark for the vertical axis.

SetVertAxisMinorTickMark

Specifies the minor tick mark for the vertical axis.

SetVertAxisTickLabelPosition

Spicifies tick label position for the vertical axis.

SetXValues

Sets the x-axis values to all chart series. It is used with the scatter charts only.

Example

Copy code
builder.CreateFile("pptx");
var oPresentation = Api.GetPresentation();
var oSlide = oPresentation.GetSlideByIndex(0);
oSlide.RemoveAllObjects();
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", 13);
oChart.SetSize(300 * 36000, 130 * 36000);
oChart.SetPosition(608400, 1267200);
var oFill = Api.CreateSolidFill(Api.CreateRGBColor(51, 51, 51));
oChart.SetSeriesFill(oFill, 0, false);
oFill = Api.CreateSolidFill(Api.CreateRGBColor(255, 111, 61));
oChart.SetSeriesFill(oFill, 1, false);
oSlide.AddObject(oChart);
builder.SaveFile("pptx", "ApiChart.pptx");
builder.CloseFile();

Resulting document