Spread Silverlight Documentation
SetSparkline(Int32,Int32,CellRange,DataOrientation,SparklineType,SparklineSetting) Method
Example 


GrapeCity.Windows.SpreadSheet.Data Namespace > Worksheet Class > SetSparkline Method : SetSparkline(Int32,Int32,CellRange,DataOrientation,SparklineType,SparklineSetting) Method
The row.
The column.
The data range.
The data orientation.
The sparkline type.
The sparkline setting.
Sets the sparkline to a cell.
Syntax
'Declaration
 
Public Overloads Function SetSparkline( _
   ByVal row As System.Integer, _
   ByVal column As System.Integer, _
   ByVal dataRange As CellRange, _
   ByVal dataOrientation As DataOrientation, _
   ByVal type As SparklineType, _
   ByVal setting As SparklineSetting _
) As Sparkline
'Usage
 
Dim instance As Worksheet
Dim row As System.Integer
Dim column As System.Integer
Dim dataRange As CellRange
Dim dataOrientation As DataOrientation
Dim type As SparklineType
Dim setting As SparklineSetting
Dim value As Sparkline
 
value = instance.SetSparkline(row, column, dataRange, dataOrientation, type, setting)
public Sparkline SetSparkline( 
   System.int row,
   System.int column,
   CellRange dataRange,
   DataOrientation dataOrientation,
   SparklineType type,
   SparklineSetting setting
)

Parameters

row
The row.
column
The column.
dataRange
The data range.
dataOrientation
The data orientation.
type
The sparkline type.
setting
The sparkline setting.

Return Value

The sparkline.
Example
This example uses the SetSparkline method.
GrapeCity.Windows.SpreadSheet.Data.CellRange cellr = new GrapeCity.Windows.SpreadSheet.Data.CellRange(0, 0, 1, 5);
GrapeCity.Windows.SpreadSheet.Data.CellRange cellr2 = new GrapeCity.Windows.SpreadSheet.Data.CellRange(1, 0, 1, 5);
GrapeCity.Windows.SpreadSheet.Data.SparklineSetting ex = new GrapeCity.Windows.SpreadSheet.Data.SparklineSetting();
ex.AxisColor = System.Windows.SystemColors.ActiveBorderColor;
ex.LineWeight = 1;
ex.ShowMarkers = true;
ex.MarkersColor = Color.FromArgb(255, 255, 0, 128);
ex.ShowFirst = true;
ex.ShowHigh = true;
//ex.ShowLow = true;
ex.ShowLast = true;
ex.ShowNegative = true;
ex.FirstMarkerColor = Color.FromArgb(255, 163, 73, 164);
ex.HighMarkerColor = Color.FromArgb(255, 49, 78, 111);
ex.LastMarkerColor = Color.FromArgb(255, 0, 255, 255);
//ex.LowMarkerColor = Color.FromArgb(255, 255, 255, 0);
ex.NegativeColor = Color.FromArgb(255, 255, 255, 0);
gcSpreadSheet1.Sheets[0].Cells[0, 0].Value = 2;
gcSpreadSheet1.Sheets[0].Cells[0, 1].Value = 5;
gcSpreadSheet1.Sheets[0].Cells[0, 2].Value = 4;
gcSpreadSheet1.Sheets[0].Cells[0, 3].Value = -1;
gcSpreadSheet1.Sheets[0].Cells[0, 4].Value = 3;
gcSpreadSheet1.Sheets[0].Cells[1, 0].Value = new DateTime(2011, 1, 11);
gcSpreadSheet1.Sheets[0].Cells[1, 1].Value = new DateTime(2011, 1, 08);
gcSpreadSheet1.Sheets[0].Cells[1, 2].Value = new DateTime(2011, 1, 09);
gcSpreadSheet1.Sheets[0].Cells[1, 3].Value = new DateTime(2011, 1, 14);
gcSpreadSheet1.Sheets[0].Cells[1, 4].Value = new DateTime(2011, 1, 20);
gcSpreadSheet1.Sheets[0].SetSparkline(0, 5, cellr, GrapeCity.Windows.SpreadSheet.Data.DataOrientation.Horizontal, GrapeCity.Windows.SpreadSheet.Data.SparklineType.Line, ex);
//gcSpreadSheet1.Sheets[0].SetSparkline(0, 5, cellr, GrapeCity.Windows.SpreadSheet.Data.DataOrientation.Horizontal, GrapeCity.Windows.SpreadSheet.Data.SparklineType.Column, cellr2, GrapeCity.Windows.SpreadSheet.Data.DataOrientation.Horizontal, ex);
gcSpreadSheet1.Invalidate();
Dim cellr As New GrapeCity.Windows.SpreadSheet.Data.CellRange(0, 0, 1, 5)
Dim cellr2 As New GrapeCity.Windows.SpreadSheet.Data.CellRange(1, 0, 1, 5)
Dim ex As New GrapeCity.Windows.SpreadSheet.Data.SparklineSetting()
ex.AxisColor = System.Windows.SystemColors.ActiveBorderColor
ex.LineWeight = 1
ex.ShowMarkers = True
ex.MarkersColor = Color.FromArgb(255, 255, 0, 128)
ex.ShowFirst = True
ex.ShowHigh = True
'ex.ShowLow = True
ex.ShowLast = True
ex.ShowNegative = True
ex.FirstMarkerColor = Color.FromArgb(255, 163, 73, 164)
ex.HighMarkerColor = Color.FromArgb(255, 49, 78, 111)
ex.LastMarkerColor = Color.FromArgb(255, 0, 255, 255)
'ex.LowMarkerColor = Color.FromArgb(255, 255, 255, 0)
ex.NegativeColor = Color.FromArgb(255, 255, 255, 0)
GcSpreadSheet1.Sheets(0).Cells(0, 0).Value = 2
GcSpreadSheet1.Sheets(0).Cells(0, 1).Value = 5
GcSpreadSheet1.Sheets(0).Cells(0, 2).Value = 4
GcSpreadSheet1.Sheets(0).Cells(0, 3).Value = -1
GcSpreadSheet1.Sheets(0).Cells(0, 4).Value = 3
GcSpreadSheet1.Sheets(0).Cells(1, 0).Value = new DateTime(2011, 1, 11)
GcSpreadSheet1.Sheets(0).Cells(1, 1).Value = new DateTime(2011, 1, 08)
GcSpreadSheet1.Sheets(0).Cells(1, 2).Value = new DateTime(2011, 1, 09)
GcSpreadSheet1.Sheets(0).Cells(1, 3).Value = new DateTime(2011, 1, 14)
GcSpreadSheet1.Sheets(0).Cells(1, 4).Value = new DateTime(2011, 1, 20)
GcSpreadSheet1.Sheets(0).SetSparkline(0, 5, cellr, GrapeCity.Windows.SpreadSheet.Data.DataOrientation.Horizontal, GrapeCity.Windows.SpreadSheet.Data.SparklineType.Line, ex)
'GcSpreadSheet1.Sheets(0).SetSparkline(0, 5, cellr, GrapeCity.Windows.SpreadSheet.Data.DataOrientation.Horizontal, GrapeCity.Windows.SpreadSheet.Data.SparklineType.Column, cellr2, GrapeCity.Windows.SpreadSheet.Data.DataOrientation.Horizontal, ex)
GcSpreadSheet1.Invalidate()
See Also

Reference

Worksheet Class
Worksheet Members
Overload List