Get Started
Usage API
More information

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 oDrawing = Api.CreateChart("bar3D", [
  [200, 240, 280],
  [250, 260, 280]
], ["Projected Revenue", "Estimated Costs"], [2014, 2015, 2016], 4051300, 2347595, 24);
oDrawing.SetVerAxisTitle("USD In Hundred Thousands", 10);
oDrawing.SetHorAxisTitle("Year", 11);
oDrawing.SetLegendPos("bottom");
oDrawing.SetShowDataLabels(false, false, true, false);
oDrawing.SetTitle("Financial Overview", 13);
oParagraph.AddDrawing(oDrawing);
builder.SaveFile("docx", "ApiChart.docx");
builder.CloseFile();

Resulting document