[]
Creates a new sparkline group and returns an ISparklineGroup object.
Use this method to create sparklines in the current ISparklineGroups collection from the specified source data range.
ISparklineGroup Add(SparkType type, string sourceData)
Function Add(type As SparkType, sourceData As String) As ISparklineGroup
| Type | Name | Description |
|---|---|---|
| SparkType | type | The type of sparkline. |
| string | sourceData | The range reference string to use as the source data for the sparkline group. |
| Type | Description |
|---|---|
| ISparklineGroup | The newly created ISparklineGroup object. |
worksheet.Range["A1:C4"].Value = new object[,] {
{1, 2, 3},
{4, 5, 6},
{7, 8, 9},
{10, 11, 12}
};
ISparklineGroup sparklineGroup = worksheet.Range["D1:D4"].SparklineGroups.Add(SparkType.Line, "A1:C4");