PowerTools SPREAD for Windows Forms 8.0J
Formula プロパティ (SeriesDataField)


数式を取得または設定します。
構文
'Declaration
 
Public Property Formula As String
'使用法
 
Dim instance As SeriesDataField
Dim value As String
 
instance.Formula = value
 
value = instance.Formula
public string Formula {get; set;}

プロパティ値

数式。
次のサンプルコードは、Formulaプロパティを使用します。
object[,] values = { { "lg1", "lg2", "lg3" }, { "tt1", 2.0, 5.0 }, { "tt2", 4.0, 5.0 } };
fpSpread1.Sheets[0].SetArray(0, 0, values);
FarPoint.Win.Spread.Model.CellRange cellRange = new FarPoint.Win.Spread.Model.CellRange(0,0,values.GetLength(0),values.GetLength(1));
fpSpread1.Sheets[0].AddChart(cellRange, typeof(FarPoint.Win.Chart.BarSeries), 400, 400, 0, 0); 
   

        private void button1_Click(object sender, EventArgs e)
        {
FarPoint.Win.Chart.BarSeries series = (FarPoint.Win.Chart.BarSeries)fpSpread1.Sheets[0].Charts[0].Model.PlotAreas[0].Series[0];
FarPoint.Win.Spread.Chart.SeriesDataField data = (FarPoint.Win.Spread.Chart.SeriesDataField)series.Values.DataSource;
data.Formula = "Sheet1!$B$2:$E$1";
        }
Dim values As Object(,) = {{"lg1", "lg2", "lg3"}, {"tt1", 2.0R, 5.0R}, {"tt2", 4.0R, 5.0R}}
FpSpread1.Sheets(0).SetArray(0, 0, values)
Dim cellRange As New FarPoint.Win.Spread.Model.CellRange(0, 0, values.GetLength(0), values.GetLength(1))
FpSpread1.Sheets(0).AddChart(cellRange, GetType(FarPoint.Win.Chart.BarSeries), 400, 400, 0, 0)

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim series As FarPoint.Win.Chart.BarSeries = DirectCast(FpSpread1.Sheets(0).Charts(0).Model.PlotAreas(0).Series(0), FarPoint.Win.Chart.BarSeries)
Dim data As FarPoint.Win.Spread.Chart.SeriesDataField = DirectCast(series.Values.DataSource, FarPoint.Win.Spread.Chart.SeriesDataField)
data.Formula = "Sheet1!$B$2:$E$1"
End Sub
参照

SeriesDataField クラス
SeriesDataField メンバ

 

 


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