Spread for ASP.NET 9.0 Product Documentation
Add Method (DoubleCollection)
Example 


Double value
Adds a double value to the collection.
Syntax
'Declaration
 
Public Sub Add( _
   ByVal item As Double _
) 
'Usage
 
Dim instance As DoubleCollection
Dim item As Double
 
instance.Add(item)
public void Add( 
   double item
)

Parameters

item
Double value
Example
This example uses the Add method.
FarPoint.Web.Chart.PieSeries series = new FarPoint.Web.Chart.PieSeries();

       protected void Page_Load(object sender, EventArgs e)
    {
        series.SeriesName = "Series 1";
        series.TopBevel = new FarPoint.Web.Chart.CircleBevel(12.0f, 12.0f);
        series.BottomBevel = new FarPoint.Web.Chart.CircleBevel(12.0f, 12.0f);
        series.Values.Add(1.0);
        series.Values.Add(2.0);
        series.Values.Add(4.0);
        series.Values.Add(8.0);

        FarPoint.Web.Chart.PiePlotArea plotArea = new FarPoint.Web.Chart.PiePlotArea();
        plotArea.Location = new System.Drawing.PointF(0.2f, 0.2f);
        plotArea.Size = new System.Drawing.SizeF(0.6f, 0.6f);
        plotArea.Series.Add(series);


        FarPoint.Web.Chart.ChartModel model = new FarPoint.Web.Chart.ChartModel();
        model.PlotAreas.Add(plotArea);
        FarPoint.Web.Spread.Chart.SpreadChart chart = new FarPoint.Web.Spread.Chart.SpreadChart();
        chart.Model = model;
        FpSpread1.Sheets[0].Charts.Add(chart);       
    }

protected void Button1_Click(object sender, EventArgs e)
        {
    series.Values.Clear();        
        }

protected void button2_Click(object sender, EventArgs e)
        {
    series.Values[3] = 1;
        }

protected void button3_Click(object sender, EventArgs e)
        {
    double v;
    v = series.Values[3];
    textBox1.Text = v.ToString();
        }
Dim series As New FarPoint.Web.Chart.PieSeries()

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        series.SeriesName = "Series 1"
        series.TopBevel = New FarPoint.Web.Chart.CircleBevel(12.0F, 12.0F)
        series.BottomBevel = New FarPoint.Web.Chart.CircleBevel(12.0F, 12.0F)
        series.Values.Add(1.0)
        series.Values.Add(2.0)
        series.Values.Add(4.0)
        series.Values.Add(8.0)

        Dim plotArea As New FarPoint.Web.Chart.PiePlotArea()
        plotArea.Location = New System.Drawing.PointF(0.2F, 0.2F)
        plotArea.Size = New System.Drawing.SizeF(0.6F, 0.6F)
        plotArea.series.Add(series)

        Dim model As New FarPoint.Web.Chart.ChartModel()
        model.PlotAreas.Add(plotArea)
        Dim chart As New FarPoint.Web.Spread.Chart.SpreadChart()
        chart.Model = model
        FpSpread1.Sheets(0).Charts.Add(chart)
End Sub

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        series.Values(3) = 1
End Sub

Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
     series.Values.Clear()
End Sub

Private Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
         Dim v As Double
         v = series.Values(3)
         TextBox1.Text = v.ToString()
End Sub
Requirements

Target Platforms: Windows 7, Windows 8, Windows 10, Windows Vista, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows XP Professional

See Also

Reference

DoubleCollection Class
DoubleCollection Members

 

 


Copyright © GrapeCity, inc. All rights reserved.