图表资源类型Chart resource type

表示工作簿中的 chart 对象。Represents a chart object in a workbook.

方法Methods

方法Method 返回类型Return Type 说明Description
获取图表Get Chart WorkbookChartWorkbookChart 读取 chart 对象的属性和关系。Read properties and relationships of chart object.
创建 ChartSeriesCreate ChartSeries WorkbookChartSeriesWorkbookChartSeries 通过发布到序列集合创建新的 ChartSeries。Create a new ChartSeries by posting to the series collection.
创建系列List series WorkbookChartSeries集合WorkbookChartSeries collection 获取 ChartSeries 对象集合。Get a ChartSeries object collection.
UpdateUpdate WorkbookChartWorkbookChart 更新 Chart 对象。Update Chart object.
图像Image 图像 base64 编码字符串Image base64 encoded string 通过缩放图表适应指定的尺寸,将图表呈现为 base64 编码的图像。Renders the chart as a base64-encoded image by scaling the chart to fit the specified dimensions.
删除Delete None 删除 chart 对象。Deletes the chart object.
SetdataSetdata None 重置图表的源数据。Resets the source data for the chart.
SetpositionSetposition None 相对于工作表上的单元格放置图表。Positions the chart relative to cells on the worksheet.
ListList WorkbookChart集合WorkbookChart collection 获取 chart 对象集合。Get chart object collection.
ItematItemat WorkbookChartWorkbookChart 根据其在集合中的位置获取图表。Gets a chart based on its position in the collection.
AddAdd WorkbookChartWorkbookChart 创建新图表。Creates a new chart.

属性Properties

属性Property 类型Type 说明Description
heightheight doubledouble 表示 chart 对象的高度,以磅值表示。Represents the height, in points, of the chart object.
idid stringstring 根据其在集合中的位置获取图表。只读。Gets a chart based on its position in the collection. Read-only.
leftleft doubledouble 从图表左侧到工作表原点的距离,以磅值表示。The distance, in points, from the left side of the chart to the worksheet origin.
namename stringstring 表示 chart 对象的名称。Represents the name of a chart object.
toptop doubledouble 表示从对象左边界至第 1 行顶部(在工作表上)或图表区域顶部(在图表上)的距离,以磅值表示。Represents the distance, in points, from the top edge of the object to the top of row 1 (on a worksheet) or the top of the chart area (on a chart).
widthwidth doubledouble 表示 chart 对象的宽度,以磅值表示。Represents the width, in points, of the chart object.

RelationshipsRelationships

关系Relationship 类型Type 说明Description
axesaxes WorkbookChartAxesWorkbookChartAxes 表示图表坐标轴。只读。Represents chart axes. Read-only.
dataLabelsdataLabels WorkbookChartDataLabelsWorkbookChartDataLabels 表示图表上的数据标签。只读。Represents the datalabels on the chart. Read-only.
formatformat WorkbookChartAreaFormatWorkbookChartAreaFormat 封装图表区域的格式属性。只读。Encapsulates the format properties for the chart area. Read-only.
legendlegend WorkbookChartLegendWorkbookChartLegend 表示图表的图例。只读。Represents the legend for the chart. Read-only.
seriesseries WorkbookChartSeries集合WorkbookChartSeries collection 表示单个系列或图表中的系列集合。只读。Represents either a single series or collection of series in the chart. Read-only.
titletitle WorkbookChartTitleWorkbookChartTitle 表示指定图表的标题,包括标题的文本、可见性、位置和格式。只读。Represents the title of the specified chart, including the text, visibility, position and formating of the title. Read-only.
工作表worksheet WorkbookWorksheetWorkbookWorksheet 包含当前 chart 的 worksheet 对象。只读。The worksheet containing the current chart. Read-only.

JSON 表示形式JSON representation

下面是资源的 JSON 表示形式。Here is a JSON representation of the resource.

{
  "height": 1024,
  "id": "string",
  "left": 1024,
  "name": "string",
  "top": 1024,
  "width": 1024
}