Excel.ChartSeries class

グラフのデータ系列を表します。

Extends

注釈

[ API セット: ExcelApi 1.1 ]

プロパティ

axisGroup

指定した系列のグループを指定します。

binOptions

ヒストグラム図とパレート図のビンのオプションをカプセル化します。

boxwhiskerOptions

箱ひげ図グラフのオプションをカプセル化します。

bubbleScale

既定のサイズのパーセンテージを表す 0 (ゼロ) から 300 までの整数値とすることができます。 このプロパティは、バブルチャートにのみ使用できます。

chartType

グラフ系列の種類を表します。 詳細は「Excel.ChartType」をご覧ください。

context

オブジェクトに関連付けられている要求コンテキスト。 これにより、アドインのプロセスが Office ホスト アプリケーションのプロセスに接続されます。

dataLabels

系列内のすべてのデータ ラベルのコレクションを表します。

doughnutHoleSize

グラフ系列のドーナツの穴の大きさを表します。 ドーナツグラフとドーナツ分解グラフでのみ有効です。 無効な InvalidArgument グラフでエラーをスローします。

explosion

円グラフまたはドーナツ グラフ スライスの展開値を指定します。 切り出し表示は行われず、スライスの先端が円の中心と一致する場合、0 を返します。

filtered

系列をフィルター処理するかどうかを指定します。 等高線グラフには適用されません。

firstSliceAngle

最初の円グラフまたはドーナツ グラフ スライスの角度を度 (垂直から時計回り) で指定します。 円グラフ、3-D 円グラフ、およびドーナツ グラフにのみ適用されます。 0 から 360 の範囲内で値を指定できます。

format

塗りつぶしと線の書式設定を含むグラフ系列の書式設定を表します。

gapWidth

グラフ系列間に設けられる間隔を表します。 横棒グラフと縦棒グラフ、および折れ線グラフと円グラフの特定のクラスでのみ有効です。 無効なグラフで無効な引数例外をスローします。

gradientMaximumColor

領域マップ グラフ系列の最大値の色を指定します。

gradientMaximumType

領域マップ グラフ系列の最大値の型を指定します。

gradientMaximumValue

領域マップ グラフ系列の最大値を指定します。

gradientMidpointColor

領域マップ グラフ系列の中点値の色を指定します。

gradientMidpointType

リージョン マップ グラフ系列の中点値の型を指定します。

gradientMidpointValue

リージョン マップ グラフ系列の中点の値を指定します。

gradientMinimumColor

領域マップ グラフ系列の最小値の色を指定します。

gradientMinimumType

地域マップ グラフ系列の最小値の型を指定します。

gradientMinimumValue

領域マップ グラフ系列の最小値を指定します。

gradientStyle

領域マップ グラフの系列グラデーション スタイルを指定します。

hasDataLabels

系列にデータ ラベルがあるかどうかを指定します。

invertColor

系列内の負のデータ ポイントの塗りつぶしの色を指定します。

invertIfNegative

True の 場合は、負の数値に対応するアイテムのパターンを反転します。

mapOptions

リージョン マップ グラフのオプションをカプセル化します。

markerBackgroundColor

グラフ系列のマーカーの背景色を指定します。

markerForegroundColor

グラフ系列のマーカーの前景色を指定します。

markerSize

グラフ系列のマーカー サイズを指定します。 サポートされているサイズの範囲は 2 ~ 72 です。 サポートされている範囲外のサイズで設定されている場合、このメソッドは InvalidArgument エラーを返します。

markerStyle

グラフ系列のマーカー スタイルを指定します。 詳細は「Excel.ChartMarkerStyle」をご覧ください。

name

グラフ内の系列の名前を指定します。 名前の長さは 255 文字を超えてはなりません。

overlap

横棒と縦棒の配置方法を指定します。 -100 から 100 の範囲内で値を指定できます。 2-D 横棒グラフと 2-D 縦棒グラフにのみ適用されます。

parentLabelStrategy

ツリーマップ グラフの系列親ラベル戦略領域を指定します。

plotOrder

グラフ グループ内のグラフ系列のプロット順序を指定します。

points

系列内のすべてのポイントのコレクションを返します。

secondPlotSize

円グラフまたは円グラフの 2 番目のセクションのサイズを、1 次円グラフのサイズに対する割合として指定します。 5 から 200 の範囲内で値を指定できます。

showConnectorLines

コネクタ線をウォーターフォール グラフに表示するかどうかを指定します。

showLeaderLines

系列内のデータ ラベルごとに引出し線を表示するかどうかを指定します。

showShadow

系列に影があるかどうかを指定します。

smooth

系列がスムーズかどうかを指定します。 折れ線グラフと散布図にのみ適用されます。

splitType

円グラフまたは円グラフの 2 つのセクションを分割する方法を指定します。

splitValue

円グラフまたは円グラフの 2 つのセクションを区切るしきい値を指定します。

trendlines

系列内の近似曲線のコレクション。

varyByCategories

True を指定すると、各データ マーカーに異なる色またはパターンが割り当てられます。 グラフに含まれるデータ系列は 1 つだけでなければなりません。

xErrorBars

グラフ系列の誤差範囲オブジェクトを表します。

yErrorBars

グラフ系列の誤差範囲オブジェクトを表します。

メソッド

delete()

グラフ系列を削除します。

getDimensionDataSourceString(dimension)

グラフ系列のデータ ソースの文字列表現を取得します。 文字列表現には、セル アドレスなどの情報を指定できます。

getDimensionDataSourceString(dimensionString)

グラフ系列のデータ ソースの文字列表現を取得します。 文字列表現には、セル アドレスなどの情報を指定できます。

getDimensionDataSourceType(dimension)

グラフ系列のデータ ソースの種類を取得します。

getDimensionDataSourceType(dimensionString)

グラフ系列のデータ ソースの種類を取得します。

getDimensionValues(dimension)

グラフ系列の 1 つのディメンションから値を取得します。 これらは、指定されたディメンションと、グラフ系列のデータのマップ方法に応じて、カテゴリ値またはデータ値のいずれかです。

getDimensionValues(dimensionString)

グラフ系列の 1 つのディメンションから値を取得します。 これらは、指定されたディメンションと、グラフ系列のデータのマップ方法に応じて、カテゴリ値またはデータ値のいずれかです。

load(options)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(propertyNames)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(propertyNamesAndPaths)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

set(properties, options)

オブジェクトの複数のプロパティを同時に設定します。 適切なプロパティを持つプレーン オブジェクトまたは同じ型の別の API オブジェクトを渡すことができます。

set(properties)

既存の読み込まれたオブジェクトに基づいて、オブジェクトに複数のプロパティを同時に設定します。

setBubbleSizes(sourceData)

グラフ系列のバブル サイズを設定します。 バブル チャートにのみ適用されます。

setValues(sourceData)

グラフ系列の値を設定します。 散布図の場合は、y 軸の値を参照します。

setXAxisValues(sourceData)

グラフ系列の x 軸の値を設定します。

toJSON()

API オブジェクトが に渡されたときにより便利な出力を提供するために、JavaScript toJSON() メソッドを JSON.stringify()オーバーライドします。 (JSON.stringifyさらに、渡される オブジェクトの メソッドを呼び出 toJSON します)。元の Excel.ChartSeries オブジェクトは API オブジェクトですが、メソッドは、元の toJSON オブジェクトから読み込まれた子プロパティの浅いコピーを含むプレーンな JavaScript オブジェクト (として Excel.Interfaces.ChartSeriesData型指定) を返します。

プロパティの詳細

axisGroup

指定した系列のグループを指定します。

axisGroup: Excel.ChartAxisGroup | "Primary" | "Secondary";

プロパティ値

Excel.ChartAxisGroup | "Primary" | "Secondary"

注釈

[ API セット: ExcelApi 1.8 ]

binOptions

ヒストグラム図とパレート図のビンのオプションをカプセル化します。

readonly binOptions: Excel.ChartBinOptions;

プロパティ値

注釈

[ API セット: ExcelApi 1.9 ]

boxwhiskerOptions

箱ひげ図グラフのオプションをカプセル化します。

readonly boxwhiskerOptions: Excel.ChartBoxwhiskerOptions;

プロパティ値

注釈

[ API セット: ExcelApi 1.9 ]

bubbleScale

既定のサイズのパーセンテージを表す 0 (ゼロ) から 300 までの整数値とすることができます。 このプロパティは、バブルチャートにのみ使用できます。

bubbleScale: number;

プロパティ値

number

注釈

[ API セット: ExcelApi 1.9 ]

chartType

グラフ系列の種類を表します。 詳細は「Excel.ChartType」をご覧ください。

chartType: Excel.ChartType | "Invalid" | "ColumnClustered" | "ColumnStacked" | "ColumnStacked100" | "3DColumnClustered" | "3DColumnStacked" | "3DColumnStacked100" | "BarClustered" | "BarStacked" | "BarStacked100" | "3DBarClustered" | "3DBarStacked" | "3DBarStacked100" | "LineStacked" | "LineStacked100" | "LineMarkers" | "LineMarkersStacked" | "LineMarkersStacked100" | "PieOfPie" | "PieExploded" | "3DPieExploded" | "BarOfPie" | "XYScatterSmooth" | "XYScatterSmoothNoMarkers" | "XYScatterLines" | "XYScatterLinesNoMarkers" | "AreaStacked" | "AreaStacked100" | "3DAreaStacked" | "3DAreaStacked100" | "DoughnutExploded" | "RadarMarkers" | "RadarFilled" | "Surface" | "SurfaceWireframe" | "SurfaceTopView" | "SurfaceTopViewWireframe" | "Bubble" | "Bubble3DEffect" | "StockHLC" | "StockOHLC" | "StockVHLC" | "StockVOHLC" | "CylinderColClustered" | "CylinderColStacked" | "CylinderColStacked100" | "CylinderBarClustered" | "CylinderBarStacked" | "CylinderBarStacked100" | "CylinderCol" | "ConeColClustered" | "ConeColStacked" | "ConeColStacked100" | "ConeBarClustered" | "ConeBarStacked" | "ConeBarStacked100" | "ConeCol" | "PyramidColClustered" | "PyramidColStacked" | "PyramidColStacked100" | "PyramidBarClustered" | "PyramidBarStacked" | "PyramidBarStacked100" | "PyramidCol" | "3DColumn" | "Line" | "3DLine" | "3DPie" | "Pie" | "XYScatter" | "3DArea" | "Area" | "Doughnut" | "Radar" | "Histogram" | "Boxwhisker" | "Pareto" | "RegionMap" | "Treemap" | "Waterfall" | "Sunburst" | "Funnel";

プロパティ値

Excel.ChartType | "Invalid" | "ColumnClustered" | "ColumnStacked" | "ColumnStacked100" | "3DColumnClustered" | "3DColumnStacked" | "3DColumnStacked100" | "BarClustered" | "BarStacked" | "BarStacked100" | "3DBarClustered" | "3DBarStacked" | "3DBarStacked100" | "LineStacked" | "LineStacked100" | "LineMarkers" | "LineMarkersStacked" | "LineMarkersStacked100" | "PieOfPie" | "PieExploded" | "3DPieExploded" | "BarOfPie" | "XYScatterSmooth" | "XYScatterSmoothNoMarkers" | "XYScatterLines" | "XYScatterLinesNoMarkers" | "AreaStacked" | "AreaStacked100" | "3DAreaStacked" | "3DAreaStacked100" | "DoughnutExploded" | "RadarMarkers" | "RadarFilled" | "Surface" | "SurfaceWireframe" | "SurfaceTopView" | "SurfaceTopViewWireframe" | "Bubble" | "Bubble3DEffect" | "StockHLC" | "StockOHLC" | "StockVHLC" | "StockVOHLC" | "CylinderColClustered" | "CylinderColStacked" | "CylinderColStacked100" | "CylinderBarClustered" | "CylinderBarStacked" | "CylinderBarStacked100" | "CylinderCol" | "ConeColClustered" | "ConeColStacked" | "ConeColStacked100" | "ConeBarClustered" | "ConeBarStacked" | "ConeBarStacked100" | "ConeCol" | "PyramidColClustered" | "PyramidColStacked" | "PyramidColStacked100" | "PyramidBarClustered" | "PyramidBarStacked" | "PyramidBarStacked100" | "PyramidCol" | "3DColumn" | "Line" | "3DLine" | "3DPie" | "Pie" | "XYScatter" | "3DArea" | "Area" | "Doughnut" | "Radar" | "Histogram" | "Boxwhisker" | "Pareto" | "RegionMap" | "Treemap" | "Waterfall" | "Sunburst" | "Funnel"

注釈

[ API セット: ExcelApi 1.7 ]

context

オブジェクトに関連付けられている要求コンテキスト。 これにより、アドインのプロセスが Office ホスト アプリケーションのプロセスに接続されます。

context: RequestContext;

プロパティ値

dataLabels

系列内のすべてのデータ ラベルのコレクションを表します。

readonly dataLabels: Excel.ChartDataLabels;

プロパティ値

注釈

[ API セット: ExcelApi 1.8 ]

doughnutHoleSize

グラフ系列のドーナツの穴の大きさを表します。 ドーナツグラフとドーナツ分解グラフでのみ有効です。 無効な InvalidArgument グラフでエラーをスローします。

doughnutHoleSize: number;

プロパティ値

number

注釈

[ API セット: ExcelApi 1.7 ]

explosion

円グラフまたはドーナツ グラフ スライスの展開値を指定します。 切り出し表示は行われず、スライスの先端が円の中心と一致する場合、0 を返します。

explosion: number;

プロパティ値

number

注釈

[ API セット: ExcelApi 1.8 ]

filtered

系列をフィルター処理するかどうかを指定します。 等高線グラフには適用されません。

filtered: boolean;

プロパティ値

boolean

注釈

[ API セット: ExcelApi 1.7 ]

firstSliceAngle

最初の円グラフまたはドーナツ グラフ スライスの角度を度 (垂直から時計回り) で指定します。 円グラフ、3-D 円グラフ、およびドーナツ グラフにのみ適用されます。 0 から 360 の範囲内で値を指定できます。

firstSliceAngle: number;

プロパティ値

number

注釈

[ API セット: ExcelApi 1.8 ]

format

塗りつぶしと線の書式設定を含むグラフ系列の書式設定を表します。

readonly format: Excel.ChartSeriesFormat;

プロパティ値

注釈

[ API セット: ExcelApi 1.1 ]

gapWidth

グラフ系列間に設けられる間隔を表します。 横棒グラフと縦棒グラフ、および折れ線グラフと円グラフの特定のクラスでのみ有効です。 無効なグラフで無効な引数例外をスローします。

gapWidth: number;

プロパティ値

number

注釈

[ API セット: ExcelApi 1.7 ]

gradientMaximumColor

領域マップ グラフ系列の最大値の色を指定します。

gradientMaximumColor: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.9 ]

gradientMaximumType

領域マップ グラフ系列の最大値の型を指定します。

gradientMaximumType: Excel.ChartGradientStyleType | "ExtremeValue" | "Number" | "Percent";

プロパティ値

Excel.ChartGradientStyleType | "ExtremeValue" | "Number" | "Percent"

注釈

[ API セット: ExcelApi 1.9 ]

gradientMaximumValue

領域マップ グラフ系列の最大値を指定します。

gradientMaximumValue: number;

プロパティ値

number

注釈

[ API セット: ExcelApi 1.9 ]

gradientMidpointColor

領域マップ グラフ系列の中点値の色を指定します。

gradientMidpointColor: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.9 ]

gradientMidpointType

リージョン マップ グラフ系列の中点値の型を指定します。

gradientMidpointType: Excel.ChartGradientStyleType | "ExtremeValue" | "Number" | "Percent";

プロパティ値

Excel.ChartGradientStyleType | "ExtremeValue" | "Number" | "Percent"

注釈

[ API セット: ExcelApi 1.9 ]

gradientMidpointValue

リージョン マップ グラフ系列の中点の値を指定します。

gradientMidpointValue: number;

プロパティ値

number

注釈

[ API セット: ExcelApi 1.9 ]

gradientMinimumColor

領域マップ グラフ系列の最小値の色を指定します。

gradientMinimumColor: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.9 ]

gradientMinimumType

地域マップ グラフ系列の最小値の型を指定します。

gradientMinimumType: Excel.ChartGradientStyleType | "ExtremeValue" | "Number" | "Percent";

プロパティ値

Excel.ChartGradientStyleType | "ExtremeValue" | "Number" | "Percent"

注釈

[ API セット: ExcelApi 1.9 ]

gradientMinimumValue

領域マップ グラフ系列の最小値を指定します。

gradientMinimumValue: number;

プロパティ値

number

注釈

[ API セット: ExcelApi 1.9 ]

gradientStyle

領域マップ グラフの系列グラデーション スタイルを指定します。

gradientStyle: Excel.ChartGradientStyle | "TwoPhaseColor" | "ThreePhaseColor";

プロパティ値

Excel.ChartGradientStyle | "TwoPhaseColor" | "ThreePhaseColor"

注釈

[ API セット: ExcelApi 1.9 ]

hasDataLabels

系列にデータ ラベルがあるかどうかを指定します。

hasDataLabels: boolean;

プロパティ値

boolean

注釈

[ API セット: ExcelApi 1.7 ]

invertColor

系列内の負のデータ ポイントの塗りつぶしの色を指定します。

invertColor: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.9 ]

invertIfNegative

True の 場合は、負の数値に対応するアイテムのパターンを反転します。

invertIfNegative: boolean;

プロパティ値

boolean

注釈

[ API セット: ExcelApi 1.8 ]

mapOptions

リージョン マップ グラフのオプションをカプセル化します。

readonly mapOptions: Excel.ChartMapOptions;

プロパティ値

注釈

[ API セット: ExcelApi 1.9 ]

markerBackgroundColor

グラフ系列のマーカーの背景色を指定します。

markerBackgroundColor: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.7 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-series-markers.yaml

await Excel.run(async (context) => {
    let sheet = context.workbook.worksheets.getItem("Sample");
    let salesTable = sheet.tables.getItem("SalesTable");
    let dataRange = sheet.getRange("A1:E7");

    // Create an XY scatter chart.
    let chart = sheet.charts.add("XYScatterSmooth", dataRange, "Auto");
    chart.title.text = "Bicycle Parts Quarterly Sales"; 
  
    let series = chart.series;
    let series0 = series.getItemAt(0);
    let series1 = series.getItemAt(1);
    let series2 = series.getItemAt(2);
    let series3 = series.getItemAt(3);

    // Set markers.
    series0.markerStyle = "Dash";
    series0.markerForegroundColor = "black";
    series1.markerStyle = "Star";
    series1.markerForegroundColor = "black";
    series2.markerStyle = "X";
    series2.markerSize = 12;
    series3.markerStyle = "Triangle";
    series3.markerBackgroundColor = "purple";

    await context.sync();
});

markerForegroundColor

グラフ系列のマーカーの前景色を指定します。

markerForegroundColor: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.7 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-series-markers.yaml

await Excel.run(async (context) => {
    let sheet = context.workbook.worksheets.getItem("Sample");
    let salesTable = sheet.tables.getItem("SalesTable");
    let dataRange = sheet.getRange("A1:E7");

    // Create an XY scatter chart.
    let chart = sheet.charts.add("XYScatterSmooth", dataRange, "Auto");
    chart.title.text = "Bicycle Parts Quarterly Sales"; 
  
    let series = chart.series;
    let series0 = series.getItemAt(0);
    let series1 = series.getItemAt(1);
    let series2 = series.getItemAt(2);
    let series3 = series.getItemAt(3);

    // Set markers.
    series0.markerStyle = "Dash";
    series0.markerForegroundColor = "black";
    series1.markerStyle = "Star";
    series1.markerForegroundColor = "black";
    series2.markerStyle = "X";
    series2.markerSize = 12;
    series3.markerStyle = "Triangle";
    series3.markerBackgroundColor = "purple";

    await context.sync();
});

markerSize

グラフ系列のマーカー サイズを指定します。 サポートされているサイズの範囲は 2 ~ 72 です。 サポートされている範囲外のサイズで設定されている場合、このメソッドは InvalidArgument エラーを返します。

markerSize: number;

プロパティ値

number

注釈

[ API セット: ExcelApi 1.7 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-series-markers.yaml

await Excel.run(async (context) => {
    let sheet = context.workbook.worksheets.getItem("Sample");
    let salesTable = sheet.tables.getItem("SalesTable");
    let dataRange = sheet.getRange("A1:E7");

    // Create an XY scatter chart.
    let chart = sheet.charts.add("XYScatterSmooth", dataRange, "Auto");
    chart.title.text = "Bicycle Parts Quarterly Sales"; 
  
    let series = chart.series;
    let series0 = series.getItemAt(0);
    let series1 = series.getItemAt(1);
    let series2 = series.getItemAt(2);
    let series3 = series.getItemAt(3);

    // Set markers.
    series0.markerStyle = "Dash";
    series0.markerForegroundColor = "black";
    series1.markerStyle = "Star";
    series1.markerForegroundColor = "black";
    series2.markerStyle = "X";
    series2.markerSize = 12;
    series3.markerStyle = "Triangle";
    series3.markerBackgroundColor = "purple";

    await context.sync();
});

markerStyle

グラフ系列のマーカー スタイルを指定します。 詳細は「Excel.ChartMarkerStyle」をご覧ください。

markerStyle: Excel.ChartMarkerStyle | "Invalid" | "Automatic" | "None" | "Square" | "Diamond" | "Triangle" | "X" | "Star" | "Dot" | "Dash" | "Circle" | "Plus" | "Picture";

プロパティ値

Excel.ChartMarkerStyle | "Invalid" | "Automatic" | "None" | "Square" | "Diamond" | "Triangle" | "X" | "Star" | "Dot" | "Dash" | "Circle" | "Plus" | "Picture"

注釈

[ API セット: ExcelApi 1.7 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-series-markers.yaml

await Excel.run(async (context) => {
    let sheet = context.workbook.worksheets.getItem("Sample");
    let salesTable = sheet.tables.getItem("SalesTable");
    let dataRange = sheet.getRange("A1:E7");

    // Create an XY scatter chart.
    let chart = sheet.charts.add("XYScatterSmooth", dataRange, "Auto");
    chart.title.text = "Bicycle Parts Quarterly Sales"; 
  
    let series = chart.series;
    let series0 = series.getItemAt(0);
    let series1 = series.getItemAt(1);
    let series2 = series.getItemAt(2);
    let series3 = series.getItemAt(3);

    // Set markers.
    series0.markerStyle = "Dash";
    series0.markerForegroundColor = "black";
    series1.markerStyle = "Star";
    series1.markerForegroundColor = "black";
    series2.markerStyle = "X";
    series2.markerSize = 12;
    series3.markerStyle = "Triangle";
    series3.markerBackgroundColor = "purple";

    await context.sync();
});

name

グラフ内の系列の名前を指定します。 名前の長さは 255 文字を超えてはなりません。

name: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.1 ]

overlap

横棒と縦棒の配置方法を指定します。 -100 から 100 の範囲内で値を指定できます。 2-D 横棒グラフと 2-D 縦棒グラフにのみ適用されます。

overlap: number;

プロパティ値

number

注釈

[ API セット: ExcelApi 1.8 ]

parentLabelStrategy

ツリーマップ グラフの系列親ラベル戦略領域を指定します。

parentLabelStrategy: Excel.ChartParentLabelStrategy | "None" | "Banner" | "Overlapping";

プロパティ値

Excel.ChartParentLabelStrategy | "None" | "Banner" | "Overlapping"

注釈

[ API セット: ExcelApi 1.9 ]

plotOrder

グラフ グループ内のグラフ系列のプロット順序を指定します。

plotOrder: number;

プロパティ値

number

注釈

[ API セット: ExcelApi 1.7 ]

points

系列内のすべてのポイントのコレクションを返します。

readonly points: Excel.ChartPointsCollection;

プロパティ値

注釈

[ API セット: ExcelApi 1.1 ]

secondPlotSize

円グラフまたは円グラフの 2 番目のセクションのサイズを、1 次円グラフのサイズに対する割合として指定します。 5 から 200 の範囲内で値を指定できます。

secondPlotSize: number;

プロパティ値

number

注釈

[ API セット: ExcelApi 1.8 ]

showConnectorLines

コネクタ線をウォーターフォール グラフに表示するかどうかを指定します。

showConnectorLines: boolean;

プロパティ値

boolean

注釈

[ API セット: ExcelApi 1.9 ]

showLeaderLines

系列内のデータ ラベルごとに引出し線を表示するかどうかを指定します。

showLeaderLines: boolean;

プロパティ値

boolean

注釈

[ API セット: ExcelApi 1.9 ]

showShadow

系列に影があるかどうかを指定します。

showShadow: boolean;

プロパティ値

boolean

注釈

[ API セット: ExcelApi 1.7 ]

smooth

系列がスムーズかどうかを指定します。 折れ線グラフと散布図にのみ適用されます。

smooth: boolean;

プロパティ値

boolean

注釈

[ API セット: ExcelApi 1.7 ]

splitType

円グラフまたは円グラフの 2 つのセクションを分割する方法を指定します。

splitType: Excel.ChartSplitType | "SplitByPosition" | "SplitByValue" | "SplitByPercentValue" | "SplitByCustomSplit";

プロパティ値

Excel.ChartSplitType | "SplitByPosition" | "SplitByValue" | "SplitByPercentValue" | "SplitByCustomSplit"

注釈

[ API セット: ExcelApi 1.8 ]

splitValue

円グラフまたは円グラフの 2 つのセクションを区切るしきい値を指定します。

splitValue: number;

プロパティ値

number

注釈

[ API セット: ExcelApi 1.9 ]

trendlines

系列内の近似曲線のコレクション。

readonly trendlines: Excel.ChartTrendlineCollection;

プロパティ値

注釈

[ API セット: ExcelApi 1.7 ]

varyByCategories

True を指定すると、各データ マーカーに異なる色またはパターンが割り当てられます。 グラフに含まれるデータ系列は 1 つだけでなければなりません。

varyByCategories: boolean;

プロパティ値

boolean

注釈

[ API セット: ExcelApi 1.8 ]

xErrorBars

グラフ系列の誤差範囲オブジェクトを表します。

readonly xErrorBars: Excel.ChartErrorBars;

プロパティ値

注釈

[ API セット: ExcelApi 1.9 ]

yErrorBars

グラフ系列の誤差範囲オブジェクトを表します。

readonly yErrorBars: Excel.ChartErrorBars;

プロパティ値

注釈

[ API セット: ExcelApi 1.9 ]

メソッドの詳細

delete()

グラフ系列を削除します。

delete(): void;

戻り値

void

注釈

[ API セット: ExcelApi 1.7 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-series.yaml

await Excel.run(async (context) => {
  const sheet = context.workbook.worksheets.getItem("Sample");
  const seriesCollection = sheet.charts.getItemAt(0).series;
  seriesCollection.load("count");
  await context.sync();

  if (seriesCollection.count > 0) {
    const series = seriesCollection.getItemAt(0);

    // Delete the first series.
    series.delete();
  }

  await context.sync();
});

getDimensionDataSourceString(dimension)

グラフ系列のデータ ソースの文字列表現を取得します。 文字列表現には、セル アドレスなどの情報を指定できます。

getDimensionDataSourceString(dimension: Excel.ChartSeriesDimension): OfficeExtension.ClientResult<string>;

パラメーター

dimension
Excel.ChartSeriesDimension

データの元の軸のディメンション。

戻り値

注釈

[ API セット: ExcelApi 1.15 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-data-source.yaml

// This function retrieves the data source information of a chart series in the Sample worksheet.
await Excel.run(async (context) => {
  const sheet = context.workbook.worksheets.getItem("Sample");

  // Get the first chart series from the first chart on the worksheet.
  const seriesCollection = sheet.charts.getItemAt(0).series;
  const series = seriesCollection.getItemAt(0);

  // Get the series data source string and type values. 
  const dataSourceString = series.getDimensionDataSourceString("Values");
  const dataSourceType = series.getDimensionDataSourceType("Values");

  series.load("name");
  await context.sync();
  
  // Log the data source information to the console.
  console.log(series.name + " data source string: " + dataSourceString.value);
  console.log(series.name + " data source type: " + dataSourceType.value);
});

getDimensionDataSourceString(dimensionString)

グラフ系列のデータ ソースの文字列表現を取得します。 文字列表現には、セル アドレスなどの情報を指定できます。

getDimensionDataSourceString(dimensionString: "Categories" | "Values" | "XValues" | "YValues" | "BubbleSizes"): OfficeExtension.ClientResult<string>;

パラメーター

dimensionString

"Categories" | "Values" | "XValues" | "YValues" | "BubbleSizes"

データの元の軸のディメンション。

戻り値

注釈

[ API セット: ExcelApi 1.15 ]

getDimensionDataSourceType(dimension)

グラフ系列のデータ ソースの種類を取得します。

getDimensionDataSourceType(dimension: Excel.ChartSeriesDimension): OfficeExtension.ClientResult<Excel.ChartDataSourceType>;

パラメーター

dimension
Excel.ChartSeriesDimension

データの元の軸のディメンション。

戻り値

注釈

[ API セット: ExcelApi 1.15 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-data-source.yaml

// This function retrieves the data source information of a chart series in the Sample worksheet.
await Excel.run(async (context) => {
  const sheet = context.workbook.worksheets.getItem("Sample");

  // Get the first chart series from the first chart on the worksheet.
  const seriesCollection = sheet.charts.getItemAt(0).series;
  const series = seriesCollection.getItemAt(0);

  // Get the series data source string and type values. 
  const dataSourceString = series.getDimensionDataSourceString("Values");
  const dataSourceType = series.getDimensionDataSourceType("Values");

  series.load("name");
  await context.sync();
  
  // Log the data source information to the console.
  console.log(series.name + " data source string: " + dataSourceString.value);
  console.log(series.name + " data source type: " + dataSourceType.value);
});

getDimensionDataSourceType(dimensionString)

グラフ系列のデータ ソースの種類を取得します。

getDimensionDataSourceType(dimensionString: "Categories" | "Values" | "XValues" | "YValues" | "BubbleSizes"): OfficeExtension.ClientResult<Excel.ChartDataSourceType>;

パラメーター

dimensionString

"Categories" | "Values" | "XValues" | "YValues" | "BubbleSizes"

データの元の軸のディメンション。

戻り値

注釈

[ API セット: ExcelApi 1.15 ]

getDimensionValues(dimension)

グラフ系列の 1 つのディメンションから値を取得します。 これらは、指定されたディメンションと、グラフ系列のデータのマップ方法に応じて、カテゴリ値またはデータ値のいずれかです。

getDimensionValues(dimension: Excel.ChartSeriesDimension): OfficeExtension.ClientResult<string[]>;

パラメーター

dimension
Excel.ChartSeriesDimension

データの元の軸のディメンション。

戻り値

注釈

[ API セット: ExcelApi 1.12 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-bubble-chart.yaml

await Excel.run(async (context) => {
  const sheet = context.workbook.worksheets.getItem("Sample");

  // The sample chart is of type `Excel.ChartType.bubble`.
  const bubbleChart = sheet.charts.getItem("Product Chart");

  // Get the first series in the chart.
  const firstSeries = bubbleChart.series.getItemAt(0);

  // Get the values for the dimensions we're interested in.
  const bubbleSize = firstSeries.getDimensionValues(Excel.ChartSeriesDimension.bubbleSizes);
  const xValues = firstSeries.getDimensionValues(Excel.ChartSeriesDimension.xvalues);
  const yValues = firstSeries.getDimensionValues(Excel.ChartSeriesDimension.yvalues);
  const category = firstSeries.getDimensionValues(Excel.ChartSeriesDimension.categories);

  await context.sync();

  // Log the information.
  console.log(`Series ${category.value} - X:${xValues.value},Y:${yValues.value},Bubble:${bubbleSize.value}`);
});

getDimensionValues(dimensionString)

グラフ系列の 1 つのディメンションから値を取得します。 これらは、指定されたディメンションと、グラフ系列のデータのマップ方法に応じて、カテゴリ値またはデータ値のいずれかです。

getDimensionValues(dimensionString: "Categories" | "Values" | "XValues" | "YValues" | "BubbleSizes"): OfficeExtension.ClientResult<string[]>;

パラメーター

dimensionString

"Categories" | "Values" | "XValues" | "YValues" | "BubbleSizes"

データの元の軸のディメンション。

戻り値

注釈

[ API セット: ExcelApi 1.12 ]

load(options)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(options?: Excel.Interfaces.ChartSeriesLoadOptions): Excel.ChartSeries;

パラメーター

options
Excel.Interfaces.ChartSeriesLoadOptions

読み込むオブジェクトのプロパティのオプションを提供します。

戻り値

load(propertyNames)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(propertyNames?: string | string[]): Excel.ChartSeries;

パラメーター

propertyNames

string | string[]

読み込むプロパティを指定するコンマ区切り文字列または文字列の配列。

戻り値

// Rename the 1st series of Chart1 to "New Series Name".
await Excel.run(async (context) => { 
    const chart = context.workbook.worksheets.getItem("Sheet1").charts.getItem("Chart1");    
    chart.series.getItemAt(0).name = "New Series Name";
    await context.sync();

    console.log("Series1 Renamed");
});

load(propertyNamesAndPaths)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(propertyNamesAndPaths?: {
            select?: string;
            expand?: string;
        }): Excel.ChartSeries;

パラメーター

propertyNamesAndPaths

{ select?: string; expand?: string; }

propertyNamesAndPaths.select は、読み込むプロパティを指定するコンマ区切り文字列で propertyNamesAndPaths.expand 、読み込むナビゲーション プロパティを指定するコンマ区切りの文字列です。

戻り値

set(properties, options)

オブジェクトの複数のプロパティを同時に設定します。 適切なプロパティを持つプレーン オブジェクトまたは同じ型の別の API オブジェクトを渡すことができます。

set(properties: Interfaces.ChartSeriesUpdateData, options?: OfficeExtension.UpdateOptions): void;

パラメーター

properties
Excel.Interfaces.ChartSeriesUpdateData

メソッドが呼び出されるオブジェクトのプロパティに等形的に構造化されたプロパティを持つ JavaScript オブジェクト。

options
OfficeExtension.UpdateOptions

properties オブジェクトが読み取り専用プロパティを設定しようとした場合にエラーを抑制するオプションを提供します。

戻り値

void

set(properties)

既存の読み込まれたオブジェクトに基づいて、オブジェクトに複数のプロパティを同時に設定します。

set(properties: Excel.ChartSeries): void;

パラメーター

properties
Excel.ChartSeries

戻り値

void

setBubbleSizes(sourceData)

グラフ系列のバブル サイズを設定します。 バブル チャートにのみ適用されます。

setBubbleSizes(sourceData: Range): void;

パラメーター

sourceData
Excel.Range

Rangeソース データに対応する オブジェクト。

戻り値

void

注釈

[ API セット: ExcelApi 1.7 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-bubble-chart.yaml

await Excel.run(async (context) => {
  /*
    The table is expected to look like this:
    Product, Inventory, Price, Current Market Share
    Calamansi, 2000, $2.45, 10%
    ...

    We want each bubble to represent a single row.
  */

  // Get the worksheet and table data.
  const sheet = context.workbook.worksheets.getItem("Sample");
  const table = sheet.tables.getItem("Sales");
  const dataRange = table.getDataBodyRange();

  // Get the table data without the row names.
  const valueRange = dataRange.getOffsetRange(0, 1).getResizedRange(0, -1);

  // Create the chart.
  const bubbleChart = sheet.charts.add(Excel.ChartType.bubble, valueRange);
  bubbleChart.name = "Product Chart";

  // Remove the default series, since we want a unique series for each row.
  bubbleChart.series.getItemAt(0).delete();

  // Load the data necessary to make a chart series.
  dataRange.load(["rowCount", "values"]);
  await context.sync();

  // For each row, create a chart series (a bubble).
  for (let i = 0; i < dataRange.rowCount; i++) {
    const newSeries = bubbleChart.series.add(dataRange.values[i][0], i);
    newSeries.setXAxisValues(dataRange.getCell(i, 1));
    newSeries.setValues(dataRange.getCell(i, 2));
    newSeries.setBubbleSizes(dataRange.getCell(i, 3));

    // Show the product name and market share percentage.
    newSeries.dataLabels.showSeriesName = true;
    newSeries.dataLabels.showBubbleSize = true;
    newSeries.dataLabels.showValue = false;
  }

  await context.sync();
});

setValues(sourceData)

グラフ系列の値を設定します。 散布図の場合は、y 軸の値を参照します。

setValues(sourceData: Range): void;

パラメーター

sourceData
Excel.Range

Rangeソース データに対応する オブジェクト。

戻り値

void

注釈

[ API セット: ExcelApi 1.7 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-series.yaml

await Excel.run(async (context) => {
  const sheet = context.workbook.worksheets.getItem("Sample");

  let seriesCollection = sheet.charts.getItemAt(0);
  let rangeSelection = sheet.getRange("C2:C7");
  let xRangeSelection = sheet.getRange("A1:A7");

  // Add a series.
  let newSeries = seriesCollection.series.add("Qtr2");
  newSeries.setValues(rangeSelection);
  newSeries.setXAxisValues(xRangeSelection);

  await context.sync();
});

setXAxisValues(sourceData)

グラフ系列の x 軸の値を設定します。

setXAxisValues(sourceData: Range): void;

パラメーター

sourceData
Excel.Range

Rangeソース データに対応する オブジェクト。

戻り値

void

注釈

[ API セット: ExcelApi 1.7 ]

toJSON()

API オブジェクトが に渡されたときにより便利な出力を提供するために、JavaScript toJSON() メソッドを JSON.stringify()オーバーライドします。 (JSON.stringifyさらに、渡される オブジェクトの メソッドを呼び出 toJSON します)。元の Excel.ChartSeries オブジェクトは API オブジェクトですが、メソッドは、元の toJSON オブジェクトから読み込まれた子プロパティの浅いコピーを含むプレーンな JavaScript オブジェクト (として Excel.Interfaces.ChartSeriesData型指定) を返します。

toJSON(): Excel.Interfaces.ChartSeriesData;

戻り値