Spread ASP.NET 6.0 Product Documentation
Add Method
See Also  Example Send Feedback
FarPoint.Web.Chart Assembly > FarPoint.Web.Chart Namespace > DoubleCollection Class : Add Method


item
Double value

Glossary Item Box

Adds a double value to the collection.

Syntax

Visual Basic (Declaration) 
Public Sub Add( _
   ByVal item As Double _
) 
Visual Basic (Usage)Copy Code
Dim instance As DoubleCollection
Dim item As Double
 
instance.Add(item)
C# 
public void Add( 
   double item
)

Parameters

item
Double value

Example

This example uses the Add method.
C#Copy Code
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();
        }
Visual BasicCopy Code
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 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.