跳到主要内容

ChartType

This type specifies the available chart types which can be used to create a new chart.

Type

Enumeration

Values

  • "bar"
  • "barStacked"
  • "barStackedPercent"
  • "bar3D"
  • "barStacked3D"
  • "barStackedPercent3D"
  • "barStackedPercent3DPerspective"
  • "horizontalBar"
  • "horizontalBarStacked"
  • "horizontalBarStackedPercent"
  • "horizontalBar3D"
  • "horizontalBarStacked3D"
  • "horizontalBarStackedPercent3D"
  • "lineNormal"
  • "lineStacked"
  • "lineStackedPercent"
  • "line3D"
  • "pie"
  • "pie3D"
  • "doughnut"
  • "scatter"
  • "stock"
  • "area"
  • "areaStacked"
  • "areaStackedPercent"
  • "comboBarLine"
  • "comboBarLineSecondary"
  • "comboCustom"
  • "unknown"

Example

This example shows how to create the "bar3D" chart.

// Specify the "ChartType" property of the ApiChart object used in text documents.

// How to create a chart specifying its type.

// The resulting chart will have a 'bar3D' type.

var chart = Api.CreateChart("bar3D", [[200, 240, 280],[250, 260, 280]], ["Projected Revenue", "Estimated Costs"], [2014, 2015, 2016], 4051300, 2347595, 24);

// Specify the "ChartType" property of the ApiChart object used in spreadsheets.

// The resulting chart will have a 'bar3D' type.

var chart = worksheet.AddChart("'Sheet1'!$A$1:$D$3", true, "bar3D", 2, 100 * 36000, 70 * 36000, 0, 2 * 36000, 7, 3 * 36000);