[]
Sheets.Sparklines.SparklineGroup
• new SparklineGroup(type
, setting
)
Represents a sparkline group.
Name | Type | Description |
---|---|---|
type |
SparklineType |
The type of sparkline. |
setting |
SparklineSetting |
The setting of the sparkline group. |
• setting: SparklineSetting
Indicates the sparkline settings.
• sparklineType: SparklineType
Indicates the sparkline type.
▸ add(item
): void
Adds a sparkline to the group.
example
let sheet = spread.getActiveSheet();
sheet.setArray(0, 0, [1,2,3,4,3,2,3,5]);
let dataRange = new GC.Spread.Sheets.Range(0, 0, 8, 1);
let setting = new GC.Spread.Sheets.Sparklines.SparklineSetting();
let sparkline1 = sheet.setSparkline(11, 0, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);
let sparkline2 = sheet.setSparkline(11, 3, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);
let sparkline3 = sheet.setSparkline(11, 6, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.column, setting);
let sparklineGroup = sheet.groupSparkline([sparkline1,sparkline2]);
// add a sparkline to sparkline group
sparklineGroup.add(sparkline3);
Name | Type | Description |
---|---|---|
item |
Sparkline |
The sparkline item. |
void
▸ clone(): SparklineGroup
Clones the current sparkline group.
example
let sheet = spread.getActiveSheet();
sheet.setArray(0, 0, [1,2,3,4,3,2,3,5]);
let dataRange = new GC.Spread.Sheets.Range(0, 0, 8, 1);
let setting = new GC.Spread.Sheets.Sparklines.SparklineSetting();
let sparkline1 = sheet.setSparkline(11, 0, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);
let sparkline2 = sheet.setSparkline(11, 3, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);
let sparklineGroup = sheet.groupSparkline([sparkline1,sparkline2]
let sparklineGroup2 = sparklineGroup.clone();
The cloned sparkline group.
▸ contains(item
): boolean
Determines whether the group contains a specific value.
example
let sheet = spread.getActiveSheet();
sheet.setArray(0, 0, [1,2,3,4,3,2,3,5]);
let dataRange = new GC.Spread.Sheets.Range(0, 0, 8, 1);
let setting = new GC.Spread.Sheets.Sparklines.SparklineSetting();
let sparkline1 = sheet.setSparkline(11, 0, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);
let sparkline2 = sheet.setSparkline(11, 3, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);
let sparkline3 = sheet.setSparkline(11, 6, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);
let sparklineGroup = sheet.groupSparkline([sparkline1,sparkline2]);
console.log(sparklineGroup.contains(sparkline1)); // true
console.log(sparklineGroup.contains(sparkline3)); // false
Name | Type | Description |
---|---|---|
item |
Sparkline |
The object to locate in the group. |
boolean
true
if the item is found in the group; otherwise, false
.
▸ count(): number
Represents the count of the sparkline group innerlist.
example
let sheet = spread.getActiveSheet();
sheet.setArray(0, 0, [1,2,3,4,3,2,3,5]);
let dataRange = new GC.Spread.Sheets.Range(0, 0, 8, 1);
let setting = new GC.Spread.Sheets.Sparklines.SparklineSetting();
let sparkline1 = sheet.setSparkline(11, 0, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);
let sparkline2 = sheet.setSparkline(11, 3, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);
let sparklineGroup = sheet.groupSparkline([sparkline1,sparkline2]);
console.log(sparklineGroup.count()); // 2
number
The sparkline count in the group.
▸ dateAxisData(value?
): any
Represents the date axis data.
example
let sheet = spread.getActiveSheet();
sheet.setArray(0, 0, [-1,2,3,4,3,2,3,5]);
let dataRange = new GC.Spread.Sheets.Range(0, 0, 8, 1);
let setting = new GC.Spread.Sheets.Sparklines.SparklineSetting();
let sparkline1 = sheet.setSparkline(11, 0, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);
let sparkline2 = sheet.setSparkline(11, 3, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);
let sparklineGroup = sheet.groupSparkline([sparkline1,sparkline2]);
sheet.setArray(0, 1, [1,4,6,5,3,6,10,2]);
sparklineGroup.dateAxisData(new GC.Spread.Sheets.Range(0, 1, 8, 1));
console.log(sparklineGroup.dateAxisData());
Name | Type |
---|---|
value? |
Range |
any
If no value is set, returns the date axis data; otherwise, returns undefined.
▸ dateAxisOrientation(value
): any
Represents the date axis orientation.
example
let sheet = spread.getActiveSheet();
sheet.setArray(0, 0, [-1,2,3,4,3,2,3,5]);
let dataRange = new GC.Spread.Sheets.Range(0, 0, 8, 1);
let setting = new GC.Spread.Sheets.Sparklines.SparklineSetting();
let sparkline1 = sheet.setSparkline(11, 0, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);
let sparkline2 = sheet.setSparkline(11, 3, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);
let sparklineGroup = sheet.groupSparkline([sparkline1,sparkline2]);
sheet.setArray(0, 1, [1,4,6,5,3,6,10,2]);
sparklineGroup.dateAxisData(new GC.Spread.Sheets.Range(0, 1, 8, 1));
sparklineGroup.dateAxisOrientation(GC.Spread.Sheets.Sparklines.DataOrientation.Vertical);
Name | Type |
---|---|
value |
DataOrientation |
any
If no value is set, returns the date axis orientation; otherwise, returns undefined.
▸ remove(item
): Sparkline
[]
Removes the first occurrence of a specific object from the group.
example
let sheet = spread.getActiveSheet();
sheet.setArray(0, 0, [-1,2,3,4,3,2,3,5]);
let dataRange = new GC.Spread.Sheets.Range(0, 0, 8, 1);
let setting = new GC.Spread.Sheets.Sparklines.SparklineSetting();
let sparkline1 = sheet.setSparkline(11, 0, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);
let sparkline2 = sheet.setSparkline(11, 3, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);
let sparklineGroup = sheet.groupSparkline([sparkline1,sparkline2]);
console.log(sparklineGroup.count()) // 2
sparklineGroup.remove(sparkline1);
console.log(sparklineGroup.count()) // 1
Name | Type | Description |
---|---|---|
item |
Sparkline |
The sparkline item. |
The GC.Spread.Sheets.Sparklines.Sparkline array.