[]
Represents a chart object in a worksheet.
An IChart provides access to the chart's data series, axes, title,
legend, plot area, and chart type so you can create and configure charts that
are hosted by worksheet shapes.
public interface IChart
Public Interface IChart
worksheet.Range["A1:B3"].Value = new object[,] {
{"Month", "Sales"},
{"Jan", 100},
{"Feb", 120}
};
IChart chart = worksheet.Shapes.AddChart(ChartType.ColumnClustered, 20, 20, 300, 200).Chart;
chart.SeriesCollection.Add(worksheet.Range["A1:B3"], RowCol.Columns, true, true);
| Name | Description |
|---|---|
| Area3DGroup | Gets the IChartGroup object that represents the area chart group on a 3-D chart. Use this property to access group-level settings for a 3-D area chart. |
| AreaGroups | Gets the collection of area chart groups on a 2D chart. Use this property to access the IChartGroups collection for the area chart groups in the current chart. |
| AutoScaling | Gets or sets whether a 3-D chart is automatically scaled to be closer in size to the corresponding 2-D chart. This property applies when RightAngleAxes is |
| Axes | Gets the collection of axes on the chart. |
| BackWall | Gets the IWall object that allows you to individually format the back wall of a 3-D chart. Use the returned IWall to configure properties such as the back wall's fill, line, and thickness. |
| Bar3DGroup | Gets the IChartGroup object that represents the bar chart group on a 3-D chart. Use this property to access group-level settings for a 3-D bar chart. |
| BarGroups | Gets the collection of bar chart groups on a 2D chart. Use this property to access the IChartGroups collection for the bar chart groups in the current chart. |
| BarShape | Gets or sets the shape used with the 3-D bar or column chart. |
| ChartArea | Gets the IChartArea object that represents the complete chart area of the chart. The chart area contains the chart elements outside the plotted data region, such as the chart title and legend. The plot area is the region where the chart's data is drawn; see PlotArea. |
| ChartGroups | Gets the collection of all chart groups in the chart. |
| ChartTitle | Gets the IChartTitle object that represents the title of the chart. Use the returned title object to read or modify chart title properties, such as the title text and formatting. |
| ChartType | Gets or sets the type of the chart. |
| Column3DGroup | Gets the IChartGroup object that represents the column chart group on a 3-D chart. Use this property to access group-level settings for a 3-D column chart. |
| ColumnGroups | Gets the collection of column chart groups on a 2-D chart. Use this property to access the IChartGroups collection for a column chart and then retrieve individual IChartGroup objects from that collection. |
| DataTable | Gets the IDataTable object that represents the chart data table. |
| DepthPercent | Gets or sets the depth of a 3-D chart as a percentage of the chart width. This property applies to 3-D charts. The returned value is between 20 and 2000 percent. |
| DisplayBlanksAs | Gets or sets the way that blank cells are plotted on the chart. Use NotPlotted to leave blanks as gaps, Interpolated to connect adjacent points across blanks, or Zero to plot blanks as zero values. |
| DisplayNaAsBlank | Gets or sets whether the chart displays
If this property is |
| DoughnutGroups | Gets the collection of doughnut chart groups on a 2D chart. Use this property to access the IChartGroups collection for the doughnut chart groups in the current chart. |
| Elevation | Gets or sets the elevation of the 3-D chart view in degrees. Use this property to retrieve the current vertical viewing angle applied to a 3-D chart. |
| Floor | Gets the IFloor object that represents the floor of a 3-D chart. Use this property to access floor-specific formatting and thickness settings for a 3-D chart. |
| GapDepth | Gets or sets the distance between the data series in a 3-D chart as a percentage of the marker width. This property applies to 3-D charts. The returned value is in the range from 0 to 500. |
| HasDataTable | Gets or sets a value indicating whether the chart displays a data table. |
| HasLegend | Gets or sets whether the chart has a legend. Use this property to determine whether the legend is currently displayed for the chart. |
| HasTitle | Gets or sets whether the chart has a visible title. This property indicates whether the chart title is displayed. |
| HeightPercent | Gets or sets the height of a 3-D chart as a percentage of the chart width. The returned value is between 5 and 500 percent. |
| Legend | Gets the legend for the chart. |
| Line3DGroup | Gets the IChartGroup object that represents the line chart group on a 3-D chart. Use this property to access the chart group for a chart created with Line3D. |
| LineGroups | Gets the collection of line chart groups on a 2D chart. Use this property to access the IChartGroups collection for the line chart groups in the current chart. |
| Name | Gets the name of the chart object. The returned value is the object name assigned to the chart. |
| Parent | Gets the parent IShape that contains the chart. Use this property to access the shape object that hosts the chart, such as when you need to work with the chart through the worksheet's shape collection. |
| Perspective | Gets or sets the perspective for the 3-D chart view. The returned value is between 0 and 100. This property is ignored if RightAngleAxes returns |
| Pie3DGroup | Gets the IChartGroup object that represents the pie chart group on a 3-D chart. Use this property to access group-level settings for a chart created with Pie3D. |
| PieGroups | Gets the collection of pie chart groups on a 2D chart. Use this property to access pie chart group settings exposed through IChartGroups, such as the group definitions for pie-based 2D charts. |
| PivotOptions | Gets the pivot chart button display options. |
| PivotTable | Gets the IPivotTable associated with the chart. For a PivotChart, this property returns the PivotTable that supplies the chart data. |
| PlotArea | Gets the plot area of the chart. The plot area is the region where the chart data series are drawn. |
| PlotVisibleOnly | Gets or sets whether the chart plots only visible cells.
If this property is |
| RadarGroups | Gets the collection of radar chart groups on a 2D chart. Use this property to access the IChartGroups collection for the radar chart groups in the current chart. |
| RightAngleAxes | Gets or sets whether the chart axes are displayed at right angles, regardless of chart rotation or elevation. This property applies only to 3-D line, column, and bar charts. |
| Rotation | Gets or sets the rotation of the 3-D chart view.
This property specifies the rotation of the plot area around the z-axis in degrees.
The default value is |
| SeriesCollection | Gets the collection of all series in the chart. |
| Shapes | Gets all drawing shapes in this chart. The returned list contains the drawing shapes currently embedded in the chart. If the chart does not contain any drawing shapes, an empty list is returned. |
| ShowDataLabelsOverMaximum | Gets or sets whether to show data labels when a value is greater than the maximum value on the value axis. This property indicates whether data labels remain visible for data points that exceed the current maximum value of the value axis. |
| SideWall | Gets the IWall object that allows individual formatting of the side wall of a 3-D chart. Use the returned wall to configure side-wall properties such as thickness, fill, and line formatting. |
| SurfaceGroup | Gets the IChartGroup object that represents the surface chart group on a 3-D chart. Use this property to access group-level settings for a chart created with Surface. |
| Walls | Gets the IWall object that represents the walls of a 3-D chart. Use this property to access wall formatting that applies to the chart walls as a whole. To format the side wall or back wall individually, use SideWall or BackWall. |
| XYGroups | Gets the collection of scatter chart groups on a 2D chart. Use this property to access the IChartGroups collection for the current scatter chart. Each item in the returned collection represents a scatter chart group in the chart. |
| Name | Description |
|---|---|
| AddChart(ChartType, double, double, double, double) | Creates a chart at the specified location in this chart. The new chart is positioned relative to the upper-left corner of the chart area, and the returned IShape represents the created chart shape. |
| AddChartInPixel(ChartType, double, double, double, double) | Creates a chart at the specified location in this chart using pixel-based coordinates. The new chart is positioned relative to the upper-left corner of the chart area, and the returned IShape represents the created chart shape. |
| AddConnector(ConnectorType, double, double, double, double) | Creates a connector shape in the chart area and returns the IShape object that represents the new connector shape. The connector is positioned by its start and end points relative to the upper-left corner of the chart area, in points. |
| AddConnectorInPixel(ConnectorType, double, double, double, double) | Creates a connector in the chart using pixel-based coordinates. The connector's start and end points are measured from the upper-left corner of the chart area in pixels. This method returns the IShape object that represents the newly created connector. |
| AddPicture(Stream, ImageType, double, double, double, double) | Creates a picture from an existing stream and adds it to the chart.
The picture is positioned relative to the chart area. The |
| AddPicture(string, double, double, double, double) | Creates a picture from an existing file and adds it to the chart.
The picture is positioned relative to the chart area. The |
| AddPictureInPixel(Stream, ImageType, double, double, double, double) | Creates a picture from an existing stream at the specified position and size, measured in pixels. The picture is added relative to the chart area. Use this method when the image content is available as a stream and the picture position and size need to be specified in pixel units. |
| AddPictureInPixel(string, double, double, double, double) | Creates a picture from an existing file and adds it to the chart using pixel-based coordinates. The picture is positioned relative to the upper-left corner of the chart area, and the returned IShape represents the newly created picture. |
| AddShape(AutoShapeType, double, double, double, double) | Adds an AutoShape to the chart and returns the corresponding IShape object. The shape is positioned relative to the upper-left corner of the chart area, and its size and position are specified in points. |
| AddShapeInPixel(AutoShapeType, double, double, double, double) | Creates an AutoShape in this chart using pixel-based coordinates. The shape is positioned relative to the upper-left corner of the chart area, and the returned IShape represents the newly created AutoShape. |
| Delete() | Deletes the chart from the worksheet. After this method is called, the chart is removed from the worksheet's shapes collection. |
| SetSourceData(IRange) | Sets the source data range for the chart. The specified range is used as the chart's data source. |
| SetSourceData(IRange, RowCol) | Sets the source data range for the chart and specifies whether each data series is taken from rows or columns. Use the |