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) |
C# | |
---|---|
public ExcelSparklineGroup AddSparkline( string dataRef, string locationRef, SparklineType type, ExcelSparklineSetting setting ) |
Parameters
- dataRef
- Data reference
- locationRef
- Location reference
- type
- Type of sparkline
- setting
- Setting
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.
This example creates a sparkline cell.
C# | Copy Code |
---|---|
FarPoint.Win.Spread.ExcelSparklineSetting ex = new FarPoint.Win.Spread.ExcelSparklineSetting(); ex.DisplayXAxis = true; ex.ShowMarkers = true; 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.Win.Spread.SparklineType.Line, ex); |
Visual Basic | Copy Code |
---|---|
Dim ex As New FarPoint.Win.Spread.ExcelSparklineSetting() ex.DisplayXAxis = True ex.ShowMarkers = True 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.Win.Spread.SparklineType.Line, ex) |
Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8