Spread ASP.NET 6.0 Product Documentation
AddSparkline(String,String,SparklineType,ExcelSparklineSetting) Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > SheetView Class > AddSparkline Method : AddSparkline(String,String,SparklineType,ExcelSparklineSetting) Method


dataRef
The data ref.
locationRef
The location ref.
type
The type.
setting
The setting.

Glossary Item Box

Adds the sparkline.

Syntax

Visual Basic (Declaration) 
Public Overloads Function AddSparkline( _
   ByVal dataRef As String, _
   ByVal locationRef As String, _
   ByVal type As SparklineType, _
   ByVal setting As ExcelSparklineSetting _
) As ExcelSparklineGroup
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim dataRef As String
Dim locationRef As String
Dim type As SparklineType
Dim setting As ExcelSparklineSetting
Dim value As ExcelSparklineGroup
 
value = instance.AddSparkline(dataRef, locationRef, type, setting)

Parameters

dataRef
The data ref.
locationRef
The location ref.
type
The type.
setting
The setting.

Remarks

The data for the sparkline is limited to one column or row of values. The dataref parameter is the range of cells that contains the data for the graph. The locationref is the cell or cells that the sparkline is displayed in.

Example

This example creates a sparkline in a cell.
C#Copy Code
FarPoint.Web.Spread.ExcelSparklineSetting ex = new FarPoint.Web.Spread.ExcelSparklineSetting();
ex.DisplayXAxis = true;
ex.ShowMarkers = true;
fpSpread1.Sheets[0].RowCount = 10;
fpSpread1.Sheets[0].ColumnCount = 10;
fpSpread1.Sheets[0].Cells[0, 0].Value = 2;
fpSpread1.Sheets[0].Cells[0, 1].Value = 5;
fpSpread1.Sheets[0].Cells[0, 2].Value = 4;
fpSpread1.Sheets[0].Cells[0, 3].Value = -1;
fpSpread1.Sheets[0].Cells[0, 4].Value = 3;
fpSpread1.Sheets[0].AddSparkline("Sheet1!$A$1:$E$1", "Sheet1!$A$2:$A$2", FarPoint.Web.Spread.SparklineType.Line, ex);
Visual BasicCopy Code
Dim ex As New FarPoint.Web.Spread.ExcelSparklineSetting()
ex.DisplayXAxis = True
ex.ShowMarkers = True
FpSpread1.Sheets(0).RowCount = 10
FpSpread1.Sheets(0).ColumnCount = 10
FpSpread1.Sheets(0).Cells(0, 0).Value = 2
FpSpread1.Sheets(0).Cells(0, 1).Value = 5
FpSpread1.Sheets(0).Cells(0, 2).Value = 4
FpSpread1.Sheets(0).Cells(0, 3).Value = -1
FpSpread1.Sheets(0).Cells(0, 4).Value = 3
FpSpread1.Sheets(0).AddSparkline("Sheet1!$A$1:$E$1", "Sheet1!$A$2:$A$2", FarPoint.Web.Spread.SparklineType.Line, ex)

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.