Class SeriesCollection

Class SeriesCollection

Namespace: Aspose.Cells.Charts
Assembly: Aspose.Cells.dll (25.2.0)

Aspose.Cells.Charts.Series オブジェクトのコレクションをカプセル化します。

public class SeriesCollection : CollectionBase<series>, IList<series>, ICollection<series>, IEnumerable<series>, ICollection, IEnumerable

継承

objectCollectionBase<series>SeriesCollection

実装

IList<series>, ICollection<series>, IEnumerable<series>, ICollection, IEnumerable

継承されたメンバー

CollectionBase<series>.BinarySearch(Series), CollectionBase<series>.BinarySearch(Series, IComparer<series>), CollectionBase<series>.BinarySearch(int, int, Series, IComparer<series>), CollectionBase<series>.Contains(Series), CollectionBase<series>.CopyTo(Series[]), CollectionBase<series>.CopyTo(Series[], int), CollectionBase<series>.CopyTo(int, Series[], int, int), CollectionBase<series>.Exists(Predicate<series>), CollectionBase<series>.Find(Predicate<series>), CollectionBase<series>.FindAll(Predicate<series>), CollectionBase<series>.FindIndex(Predicate<series>), CollectionBase<series>.FindIndex(int, Predicate<series>), CollectionBase<series>.FindIndex(int, int, Predicate<series>), CollectionBase<series>.FindLast(Predicate<series>), CollectionBase<series>.FindLastIndex(Predicate<series>), CollectionBase<series>.FindLastIndex(int, Predicate<series>), CollectionBase<series>.FindLastIndex(int, int, Predicate<series>), CollectionBase<series>.IndexOf(Series), CollectionBase<series>.IndexOf(Series, int), CollectionBase<series>.IndexOf(Series, int, int), CollectionBase<series>.LastIndexOf(Series), CollectionBase<series>.LastIndexOf(Series, int), CollectionBase<series>.LastIndexOf(Series, int, int), CollectionBase<series>.GetEnumerator(), CollectionBase<series>.Clear(), CollectionBase<series>.RemoveAt(int), CollectionBase<series>.OnClearComplete(), CollectionBase<series>.OnClear(), CollectionBase<series>.Capacity, CollectionBase<series>.Count, CollectionBase<series>.InnerList, CollectionBase<series>.this[int], object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

//Workbookオブジェクトのインスタンス化
Workbook workbook = new Workbook();
//Excelオブジェクトに新しいワークシートを追加
int sheetIndex = workbook.Worksheets.Add();
//シートインデックスを渡して新しく追加したワークシートの参照を取得
Worksheet worksheet = workbook.Worksheets[sheetIndex];
//"A1"セルにサンプル値を追加
worksheet.Cells["A1"].PutValue(50);
//"A2"セルにサンプル値を追加
worksheet.Cells["A2"].PutValue(100);
//"A3"セルにサンプル値を追加
worksheet.Cells["A3"].PutValue(150);
//"A4"セルにサンプル値を追加
worksheet.Cells["A4"].PutValue(200);
//"B1"セルにサンプル値を追加
worksheet.Cells["B1"].PutValue(60);
//"B2"セルにサンプル値を追加
worksheet.Cells["B2"].PutValue(32);
//"B3"セルにサンプル値を追加
worksheet.Cells["B3"].PutValue(50);
//"B4"セルにサンプル値を追加
worksheet.Cells["B4"].PutValue(40);
//カテゴリデータとして"C1"セルにサンプル値を追加
worksheet.Cells["C1"].PutValue("Q1");
//カテゴリデータとして"C2"セルにサンプル値を追加
worksheet.Cells["C2"].PutValue("Q2");
//カテゴリデータとして"C3"セルにサンプル値を追加
worksheet.Cells["C3"].PutValue("Y1");
//カテゴリデータとして"C4"セルにサンプル値を追加
worksheet.Cells["C4"].PutValue("Y2");
//ワークシートにチャートを追加
int chartIndex = worksheet.Charts.Add(ChartType.Column, 5, 0, 15, 5);
//新しく追加したチャートのインスタンスにアクセス
Chart chart = worksheet.Charts[chartIndex];
//"A1"セルから"B4"までの範囲をチャートのデータソース(NSeries)として追加
chart.NSeries.Add("A1:B4", true);
//NSeriesのカテゴリデータのデータソースを設定
chart.NSeries.CategoryData = "C1:C4";
//Excelファイルを保存
workbook.Save("book1.xls");
'Workbookオブジェクトのインスタンス化
Dim workbook As Workbook = New Workbook()
'Excelオブジェクトに新しいワークシートを追加
Dim sheetIndex As Integer = workbook.Worksheets.Add()
'シートインデックスを渡して新しく追加したワークシートの参照を取得
Dim worksheet As Worksheet = workbook.Worksheets(sheetIndex)
'A1セルにサンプル値を追加
worksheet.Cells("A1").PutValue(50)
'A2セルにサンプル値を追加
worksheet.Cells("A2").PutValue(100)
'A3セルにサンプル値を追加
worksheet.Cells("A3").PutValue(150)
'A4セルにサンプル値を追加
worksheet.Cells("A4").PutValue(200)
'B1セルにサンプル値を追加
worksheet.Cells("B1").PutValue(60)
'B2セルにサンプル値を追加
worksheet.Cells("B2").PutValue(32)
'B3セルにサンプル値を追加
worksheet.Cells("B3").PutValue(50)
'B4セルにサンプル値を追加
worksheet.Cells("B4").PutValue(40)
'C1セルにカテゴリデータとしてサンプル値を追加
worksheet.Cells("C1").PutValue("Q1")
'C2セルにカテゴリデータとしてサンプル値を追加
worksheet.Cells("C2").PutValue("Q2")
'C3セルにカテゴリデータとしてサンプル値を追加
worksheet.Cells("C3").PutValue("Y1")
'C4セルにカテゴリデータとしてサンプル値を追加
worksheet.Cells("C4").PutValue("Y2")
'ワークシートにチャートを追加
Dim chartIndex As Integer = worksheet.Charts.Add(ChartType.Column, 5, 0, 15, 5)
'新しく追加したチャートのインスタンスにアクセス
Dim chart As Chart = worksheet.Charts(chartIndex)
'A1セルからB4までの範囲をチャートのデータソース(NSeries)として追加
chart.NSeries.Add("A1:B4", True)
'NSeriesのカテゴリデータのデータソースを設定
chart.NSeries.CategoryData = "C1:C4"
'Excelファイルを保存
workbook.Save("book1.xls")

プロパティ

CategoryData

カテゴリ軸の値の範囲を取得または設定します。 セルの範囲(例: “d1:e10”)や、値のシーケンス(例: “{2,6,8,10}")であることができます。

public string CategoryData { get; set; }

プロパティ値

string

IsColorVaried

ポイントの色が異なるかどうかを示します。

public bool IsColorVaried { get; set; }

プロパティ値

bool

SecondCategoryData

第二のカテゴリ軸の値の範囲を取得または設定します。 セルの範囲(例: “d1:e10”)や、値のシーケンス(例: “{2,6,8,10}")であることができます。 一部の ASeries が第二軸にプロットされる場合にのみ影響します。

public string SecondCategoryData { get; set; }

プロパティ値

string

this[int]

指定されたインデックスの Aspose.Cells.Charts.Series 要素を取得します。

public Series this[int index] { get; }

プロパティ値

Series

メソッド

Add(string, bool)

Aspose.Cells.Charts.Series コレクションをチャートに追加します。

public int Add(string area, bool isVertical)

パラメータ

area string

データ系列をプロットするための値を指定します。

isVertical bool

行または列によってセル値の範囲から系列をプロットするかどうかを指定します。

戻り値

int

追加された ASeries の最初のインデックスを返します。

備考


連続したセルにデータを設定する場合は、コロンで区切ります。例えば、$C$2:$C$5。
非連続のセルにデータを設定する場合は、カンマで区切ります。例えば: ($C$2,$D$5)。

Add(string, bool, bool)

Aspose.Cells.Charts.Series コレクションをチャートに追加します。

public int Add(string area, bool isVertical, bool checkLabels)

パラメータ

area string

データ系列をプロットするための値を指定します。

isVertical bool

行または列によってセル値の範囲から系列をプロットするかどうかを指定します。

checkLabels bool

範囲に系列の名前が含まれているかどうかを示します。

戻り値

int

追加された ASeries の最初のインデックスを返します。

備考


連続したセルにデータを設定する場合は、コロンで区切ります。例えば、$C$2:$C$5。
非連続のセルにデータを設定する場合は、カンマで区切ります。例えば、($C$2,$D$5)。

AddR1C1(string, bool)

Aspose.Cells.Charts.Series コレクションをチャートに追加します。

public int AddR1C1(string area, bool isVertical)

パラメータ

area string

データ系列をプロットするための値を指定します。

isVertical bool

行または列によってセル値の範囲から系列をプロットするかどうかを指定します。

戻り値

int

追加された ASeries の最初のインデックスを返します。

備考


連続したセルにデータを設定する場合は、コロンで区切ります。例えば、R[1]C[1]:R[3]C[2]。
非連続のセルにデータを設定する場合は、カンマで区切ります。例えば、(R[1]C[1],R[3]C[2])。

Clear()

コレクションをクリアします。

public void Clear()

GetSeriesByOrder(int)

順序によって Aspose.Cells.Charts.Series 要素を取得します。

public Series GetSeriesByOrder(int order)

パラメータ

order int

系列の順序。

戻り値

Series

要素系列。

RemoveAt(int)

指定されたインデックスの系列を削除します。

public void RemoveAt(int index)

パラメータ

index int

インデックス。

SetSeriesNames(int, string, bool)

チャート内のすべての系列の名前を設定します。

public void SetSeriesNames(int startIndex, string area, bool isVertical)

パラメータ

startIndex int

名前を設定したい最初の系列のインデックス。

area string

系列名のための範囲を指定します。

isVertical bool

>行または列によってセル値の範囲から系列をプロットするかどうかを指定します。

備考


開始インデックスが系列の数より大きい場合、何もせずに戻ります。
連続したセルにデータを設定する場合は、コロンで区切ります。例えば、$C$2:$C$5。
非連続のセルにデータを設定する場合は、カンマで区切ります。例えば、($C$2,$D$5)。

SwapSeries(int, int)

2つの系列の順序を直接変更します。

public void SwapSeries(int sourceIndex, int destIndex)

パラメータ

sourceIndex int

現在のインデックス。

destIndex int

目的のインデックス。

 日本語