Interface ISparklines
Represents the Spraklines in Sprakline chart
Namespace: Syncfusion.XlsIO
Assembly: Syncfusion.XlsIO.NET.dll
Syntax
public interface ISparklines : IList<ISparkline>, ICollection<ISparkline>, IEnumerable<ISparkline>, IEnumerable
Methods
Add()
Adds Sparkline instance.
Declaration
Sparkline Add()
Returns
Type | Description |
---|---|
Sparkline | the Sprakline object |
Examples
The following example demonstrates the Add method.
ExcelEngine engine=new ExcelEngine();
IApplication app= engine.Excel;
app.DefaultVersion= ExcelVersion.Excel2010;
IWorkbook wkBook= app.Workbooks.Create(2);
IWorksheet sheet= wkBook.Worksheets[0];
ISparklineGroup spGroup= sheet.SparklineGroups.Add();
//Initialize the Saprklines
ISparklines sparklines=spGroup.Add();
//returns the sparkline object.
ISparkline sparkline=sparklines.Add();
wkBook.SaveAs("Sample.xlsx");
wkBook.Close();
Add(IRange, IRange)
Adds the sparkline.
Declaration
void Add(IRange dataRange, IRange referenceRange)
Parameters
Type | Name | Description |
---|---|---|
IRange | dataRange | The data range.IRange |
IRange | referenceRange | The reference range.IRange |
Examples
The following example demonstrates the Add method.
ExcelEngine engine=new ExcelEngine();
IApplication app= engine.Excel;
app.DefaultVersion= ExcelVersion.Excel2010;
IWorkbook wkBook= app.Workbooks.Create(2);
IWorksheet sheet= wkBook.Worksheets[0];
ISparklineGroup spGroup= sheet.SparklineGroups.Add();
//Initialize the Sparklines
ISparklines sparklines=spGroup.Add();
//Add the Sparklines data range and reference range.
sparklines.Add(sheet.Range["A1:B2"],sheet.Range["C1"]);
wkBook.SaveAs("Sample.xlsx");
wkBook.Close();
Add(IRange, IRange, Boolean)
Adds the sparkline.
Declaration
void Add(IRange dataRange, IRange referenceRange, bool isVertical)
Parameters
Type | Name | Description |
---|---|---|
IRange | dataRange | The data range.IRange |
IRange | referenceRange | The reference range.IRange |
System.Boolean | isVertical | Specifies whether to plot the sparklines from the new data range by row or by column. |
Examples
The following example demonstrates the Add method.
ExcelEngine engine=new ExcelEngine();
IApplication app= engine.Excel;
app.DefaultVersion= ExcelVersion.Excel2010;
IWorkbook wkBook= app.Workbooks.Create(2);
IWorksheet sheet= wkBook.Worksheets[0];
ISparklineGroup spGroup= sheet.SparklineGroups.Add();
//Initialize the Sparklines
ISparklines sparklines=spGroup.Add();
//Add the Sparklines data range and reference range.
sparklines.Add(sheet.Range["A1:B2"],sheet.Range["C1"],true);
wkBook.SaveAs("Sample.xlsx");
wkBook.Close();
Clear(Sparkline)
Clears the sparkline.
Declaration
void Clear(Sparkline sparkline)
Parameters
Type | Name | Description |
---|---|---|
Sparkline | sparkline | The sparkline range.IRange |
Examples
The following example demonstrates the Clear Method
ExcelEngine engine=new ExcelEngine();
IApplication app= engine.Excel;
app.DefaultVersion= ExcelVersion.Excel2010;
IWorkbook wkBook= app.Workbooks.Create(2);
IWorksheet sheet= wkBook.Worksheets[0];
ISparklineGroup spGroup= sheet.SparklineGroups.Add();
//Initialize the Saprklines
ISparklines sparklines=spGroup.Add();
//Clears the Sparkline from the specified range.
sparklines.Clear(sparklines[0] as Sparkline);
wkBook.SaveAs("Sample.xlsx");
wkBook.Close();
RefreshRanges(IRange, IRange)
Adds the sparkline.
Declaration
void RefreshRanges(IRange dataRange, IRange referenceRange)
Parameters
Type | Name | Description |
---|---|---|
IRange | dataRange | The data range.IRange |
IRange | referenceRange | The reference range.IRange |
Examples
The following example demonstrates the Add method.
ExcelEngine engine=new ExcelEngine();
IApplication app= engine.Excel;
app.DefaultVersion= ExcelVersion.Excel2010;
IWorkbook wkBook= app.Workbooks.Create(2);
IWorksheet sheet= wkBook.Worksheets[0];
ISparklineGroup spGroup= sheet.SparklineGroups[0];
//Initialize the Sparklines
ISparklines sparklines=spGroup[0];
//Add the Sparklines data range and reference range.
sparklines.RefreshRanges(sheet.Range["A1:B2"],sheet.Range["C1"]);
wkBook.SaveAs("Sample.xlsx");
wkBook.Close();
RefreshRanges(IRange, IRange, Boolean)
Adds the sparkline.
Declaration
void RefreshRanges(IRange dataRange, IRange referenceRange, bool isVertical)
Parameters
Type | Name | Description |
---|---|---|
IRange | dataRange | The data range.IRange |
IRange | referenceRange | The reference range.IRange |
System.Boolean | isVertical | Specifies whether to plot the sparklines from the refreshed data range by row or by column. |
Examples
The following example demonstrates the Add method.
ExcelEngine engine=new ExcelEngine();
IApplication app= engine.Excel;
app.DefaultVersion= ExcelVersion.Excel2010;
IWorkbook wkBook= app.Workbooks.Create(2);
IWorksheet sheet= wkBook.Worksheets[0];
ISparklineGroup spGroup= sheet.SparklineGroups[0];
//Initialize the Sparklines
ISparklines sparklines=spGroup[0];
//Add the Sparklines data range and reference range.
sparklines.RefreshRanges(sheet.Range["A1:B2"],sheet.Range["C1"],true);
wkBook.SaveAs("Sample.xlsx");
wkBook.Close();