Spread Windows Forms 7.0 Product Documentation
Formula Property
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Chart Namespace > SeriesDataField Class : Formula Property


Glossary Item Box

Gets or sets the formula.

Syntax

Visual Basic (Declaration) 
Public Property Formula As String
Visual Basic (Usage)Copy Code
Dim instance As SeriesDataField
Dim value As String
 
instance.Formula = value
 
value = instance.Formula
C# 
public string Formula {get; set;}

Property Value

The formula.

Example

This example uses the Formula property.
C#Copy Code
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";
        }
Visual BasicCopy Code
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

Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.