Spread Windows Forms 9.0 Product Documentation
AddRange Method (LineCollection)
Example 


Array of lines
Adds an array of lines to the collection.
Syntax
'Declaration
 
Public Sub AddRange( _
   ByVal items() As Line _
) 
'Usage
 
Dim instance As LineCollection
Dim items() As Line
 
instance.AddRange(items)
public void AddRange( 
   Line[] items
)

Parameters

items
Array of lines
Example
This example uses the AddRange method.
FarPoint.Win.Chart.BarSeries series = new FarPoint.Win.Chart.BarSeries();
series.SeriesName = "Series 0";
series.Values.Add(2.0);
series.Values.Add(4.0);
series.Values.Add(3.0);
series.Values.Add(5.0);
//series.BarBorders.Add(new FarPoint.Win.Chart.SolidLine(Color.Red)); // Add method on LineCollection class
series.BarFills.Add(new FarPoint.Win.Chart.SolidFill(Color.LightGreen)); 
// Add method on FillCollection class
series.BarBorders.AddRange(new FarPoint.Win.Chart.Line[] { new FarPoint.Win.Chart.SolidLine(Color.Black), new FarPoint.Win.Chart.SolidLine(Color.Red), new FarPoint.Win.Chart.SolidLine(Color.Aqua), null }); 

FarPoint.Win.Chart.YPlotArea plotArea = new FarPoint.Win.Chart.YPlotArea();
plotArea.Location = new PointF(0.2f, 0.2f);
plotArea.Size = new SizeF(0.6f, 0.6f);
plotArea.Series.Add(series);

FarPoint.Win.Chart.ChartModel model = new FarPoint.Win.Chart.ChartModel();
model.PlotAreas.Add(plotArea);
fpChart1.Model = model;
Dim series As New FarPoint.Win.Chart.BarSeries()
series.SeriesName = "Series 0"
series.Values.Add(2.0)
series.Values.Add(4.0)
series.Values.Add(3.0)
series.Values.Add(5.0)
'series.BarBorders.Add(New FarPoint.Win.Chart.SolidLine(Color.Red)) ' Add method on LineCollection class
series.BarFills.Add(New FarPoint.Win.Chart.SolidFill(Color.LightGreen))
' Add method on FillCollection class
series.BarBorders.AddRange(New FarPoint.Win.Chart.Line() {New FarPoint.Win.Chart.SolidLine(Color.Black), New FarPoint.Win.Chart.SolidLine(Color.Red), New FarPoint.Win.Chart.SolidLine(Color.Aqua), Nothing})

Dim plotArea As New FarPoint.Win.Chart.YPlotArea()
plotArea.Location = New PointF(0.2F, 0.2F)
plotArea.Size = New SizeF(0.6F, 0.6F)
plotArea.Series.Add(series)

Dim model As New FarPoint.Win.Chart.ChartModel()
model.PlotAreas.Add(plotArea)
FpChart1.Model = model
Requirements

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

See Also

Reference

LineCollection Class
LineCollection Members

 

 


Copyright © GrapeCity, inc. All rights reserved.