[]
        
(Showing Draft Content)

GC.Spread.Sheets.Sparklines.SparklineGroup

Class: SparklineGroup

Sheets.Sparklines.SparklineGroup

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new SparklineGroup(type, setting)

Represents a sparkline group.

Parameters

Name Type Description
type SparklineType The type of sparkline.
setting SparklineSetting The setting of the sparkline group.

Properties

setting

setting: SparklineSetting

Indicates the sparkline settings.


sparklineType

sparklineType: SparklineType

Indicates the sparkline type.

Methods

add

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);

Parameters

Name Type Description
item Sparkline The sparkline item.

Returns

void


clone

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();

Returns

SparklineGroup

The cloned sparkline group.


contains

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

Parameters

Name Type Description
item Sparkline The object to locate in the group.

Returns

boolean

true if the item is found in the group; otherwise, false.


count

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

Returns

number

The sparkline count in the group.


dateAxisData

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());

Parameters

Name Type
value? Range

Returns

any

If no value is set, returns the date axis data; otherwise, returns undefined.


dateAxisOrientation

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);

Parameters

Name Type
value DataOrientation

Returns

any

If no value is set, returns the date axis orientation; otherwise, returns undefined.


remove

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

Parameters

Name Type Description
item Sparkline The sparkline item.

Returns

Sparkline[]

The GC.Spread.Sheets.Sparklines.Sparkline array.