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 a type of the ApiChart class.

GetNextChart

Returns the next inline chart if exists.

GetPrevChart

Returns the previous inline chart if exists.

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 labels of the horizontal axis.

SetHorAxisMajorTickMark

Specifies major tick mark for the horizontal axis.

SetHorAxisMinorTickMark

Specifies minor tick mark for the horizontal axis.

SetHorAxisOrientation

Specifies the horizontal axis orientation.

SetHorAxisTickLabelPosition

Spicifies tick labels position for the horizontal axis.

SetHorAxisTitle

Specifies the chart horizontal axis title.

SetLegendFill

Sets the fill to the chart legend.

SetLegendFontSize

Specifies the legend font size.

SetLegendOutLine

Sets the outline to the chart legend.

SetLegendPos

Specifies the chart legend position.

SetMajorHorizontalGridlines

Specifies major horizontal gridline visual properties.

SetMajorVerticalGridlines

Specifies major vertical gridline visual properties.

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 minor horizontal gridline visual properties.

SetMinorVerticalGridlines

Specifies minor vertical gridline visual properties.

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 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 labels of the vertical axis.

SetVertAxisMajorTickMark

Specifies major tick mark for the vertical axis.

SetVertAxisMinorTickMark

Specifies minor tick mark for the vertical axis.

SetVertAxisTickLabelPosition

Spicifies tick labels 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("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
var oChart = Api.CreateChart("bar3D", [
  [200, 240, 280],
  [250, 260, 280]
], ["Projected Revenue", "Estimated Costs"], [2014, 2015, 2016], 4051300, 2347595, 24);
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);
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);
oParagraph.AddDrawing(oChart);
builder.SaveFile("docx", "ApiChart.docx");
builder.CloseFile();

Resulting document