PowerTools SPREAD for Windows Forms 10.0J
AddRange メソッド (StringCollection)


文字列値の配列
文字列値の配列をコレクションに追加します。
構文
'Declaration
 
Public Sub AddRange( _
   ByVal items() As String _
) 
'使用法
 
Dim instance As StringCollection
Dim items() As String
 
instance.AddRange(items)
public void AddRange( 
   string[] items
)

パラメータ

items
文字列値の配列
次のサンプルコードは、箱ひげ図を作成します。
FarPoint.Win.Chart.BoxWhiskerSeries series1 = new FarPoint.Win.Chart.BoxWhiskerSeries();
series1.SeriesName = "Store1";
series1.CategoryNames.AddRange(new string[] {"Asiago", "Gouda", "Havarti", "Swiss", "Asiago", "Gouda", "Havarti", "Swiss", "Asiago", "Gouda", "Havarti", "Swiss" });
series1.Values.Add(20);
series1.Values.Add(25);
series1.Values.Add(21);
series1.Values.Add(30);
series1.Values.Add(10);
series1.Values.Add(26);
series1.Values.Add(18);
series1.Values.Add(28);
series1.Values.Add(12);
series1.Values.Add(20);
series1.Values.Add(17);
series1.Values.Add(35);           
series1.Border = new FarPoint.Win.Chart.SolidLine(Color.Black);
series1.Fill = new FarPoint.Win.Chart.GradientFill(Color.Brown, Color.Orange);
FarPoint.Win.Chart.BoxWhiskerSeries series2 = new FarPoint.Win.Chart.BoxWhiskerSeries();
series2.SeriesName = "Store2";
series2.CategoryNames.AddRange(new string[] { "Asiago", "Gouda", "Havarti", "Swiss", "Asiago", "Gouda", "Havarti", "Swiss", "Asiago", "Gouda", "Havarti", "Swiss" });
series2.Values.Add(15);
series2.Values.Add(18);
series2.Values.Add(19);
series2.Values.Add(22);
series2.Values.Add(10);
series2.Values.Add(19);
series2.Values.Add(15);
series2.Values.Add(25);
series2.Values.Add(14);
series2.Values.Add(19);
series2.Values.Add(16);
series2.Values.Add(24);
series2.Border = new FarPoint.Win.Chart.SolidLine(Color.Black);
series2.Fill = new FarPoint.Win.Chart.GradientFill(Color.Lavender, Color.DeepSkyBlue);
FarPoint.Win.Chart.BoxWhiskerSeries series3 = new FarPoint.Win.Chart.BoxWhiskerSeries();
series3.SeriesName = "Store3";
series3.CategoryNames.AddRange(new string[] { "Asiago", "Gouda", "Havarti", "Swiss", "Asiago", "Gouda", "Havarti", "Swiss", "Asiago", "Gouda", "Havarti", "Swiss" });
series3.Values.Add(5);
series3.Values.Add(12);
series3.Values.Add(20);
series3.Values.Add(25);
series3.Values.Add(8);
series3.Values.Add(10);
series3.Values.Add(11);
series3.Values.Add(22);
series3.Values.Add(13);
series3.Values.Add(12);
series3.Values.Add(15);
series3.Values.Add(21);
FarPoint.Win.Chart.ClusteredBoxWhiskerSeries cseries = new FarPoint.Win.Chart.ClusteredBoxWhiskerSeries();
cseries.Series.Add(series1);
cseries.Series.Add(series2);
cseries.Series.Add(series3);
FarPoint.Win.Chart.YPlotArea plotArea = new FarPoint.Win.Chart.YPlotArea();
plotArea.Series.Add(cseries);
FarPoint.Win.Chart.LegendArea legend = new FarPoint.Win.Chart.LegendArea();
legend.Location = new PointF(0.80F, 0.5F);
FarPoint.Win.Chart.ChartModel model = new FarPoint.Win.Chart.ChartModel();
model.PlotAreas.Add(plotArea);
model.LegendAreas.Add(legend);
FarPoint.Win.Spread.Chart.SpreadChart chart = new FarPoint.Win.Spread.Chart.SpreadChart();
chart.Size = new Size(400, 400);
chart.Model = model;
fpSpread1.Sheets[0].Charts.Add(chart);
Dim series1 As New FarPoint.Win.Chart.BoxWhiskerSeries()
series1.SeriesName = "Store1"
series1.CategoryNames.AddRange(New String() {"Asiago", "Gouda", "Havarti", "Swiss", "Asiago", "Gouda", "Havarti", "Swiss", "Asiago", "Gouda", "Havarti", "Swiss"})
series1.Values.Add(20)
series1.Values.Add(25)
series1.Values.Add(21)
series1.Values.Add(30)
series1.Values.Add(10)
series1.Values.Add(26)
series1.Values.Add(18)
series1.Values.Add(28)
series1.Values.Add(12)
series1.Values.Add(20)
series1.Values.Add(17)
series1.Values.Add(35)
series1.Border = New FarPoint.Win.Chart.SolidLine(Color.Black)
series1.Fill = New FarPoint.Win.Chart.GradientFill(Color.Brown, Color.Orange)
Dim series2 As New FarPoint.Win.Chart.BoxWhiskerSeries()
series2.SeriesName = "Store2"
series2.CategoryNames.AddRange(New String() {"Asiago", "Gouda", "Havarti", "Swiss", "Asiago", "Gouda", "Havarti", "Swiss", "Asiago", "Gouda", "Havarti", "Swiss"})
series2.Values.Add(15)
series2.Values.Add(18)
series2.Values.Add(19)
series2.Values.Add(22)
series2.Values.Add(10)
series2.Values.Add(19)
series2.Values.Add(15)
series2.Values.Add(25)
series2.Values.Add(14)
series2.Values.Add(19)
series2.Values.Add(16)
series2.Values.Add(24)
series2.Border = New FarPoint.Win.Chart.SolidLine(Color.Black)
series2.Fill = New FarPoint.Win.Chart.GradientFill(Color.Lavender, Color.DeepSkyBlue)
Dim series3 As New FarPoint.Win.Chart.BoxWhiskerSeries()
series3.SeriesName = "Store3"
series3.CategoryNames.AddRange(New String() {"Asiago", "Gouda", "Havarti", "Swiss", "Asiago", "Gouda", "Havarti", "Swiss", "Asiago", "Gouda", "Havarti", "Swiss"})
series3.Values.Add(5)
series3.Values.Add(12)
series3.Values.Add(20)
series3.Values.Add(25)
series3.Values.Add(8)
series3.Values.Add(10)
series3.Values.Add(11)
series3.Values.Add(22)
series3.Values.Add(13)
series3.Values.Add(12)
series3.Values.Add(15)
series3.Values.Add(21)
Dim cseries As New FarPoint.Win.Chart.ClusteredBoxWhiskerSeries()
cseries.Series.Add(series1)
cseries.Series.Add(series2)
cseries.Series.Add(series3)
Dim plotArea As New FarPoint.Win.Chart.YPlotArea()
plotArea.Series.Add(cseries)
Dim legend As New FarPoint.Win.Chart.LegendArea()
legend.Location = New PointF(0.8F, 0.5F)
Dim model As New FarPoint.Win.Chart.ChartModel()
model.PlotAreas.Add(plotArea)
model.LegendAreas.Add(legend)
Dim chart As New FarPoint.Win.Spread.Chart.SpreadChart()
chart.Size = New Size(400, 400)
chart.Model = model
FpSpread1.Sheets(0).Charts.Add(chart)
参照

StringCollection クラス
StringCollection メンバ

 

 


© 2004-2017, GrapeCity inc. All rights reserved.