Spread Windows Forms 12.0 Product Documentation
Formula Property (SeriesDataField)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Chart Namespace > SeriesDataField Class : Formula Property
Gets or sets the formula.
Syntax
'Declaration
 
Public Property Formula As String
'Usage
 
Dim instance As SeriesDataField
Dim value As String
 
instance.Formula = value
 
value = instance.Formula
public string Formula {get; set;}

Property Value

The formula.
Example
This example uses the Formula property.
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
See Also

Reference

SeriesDataField Class
SeriesDataField Members