[]
        
(Showing Draft Content)

GC.Spread.Sheets.Sparklines.SparklineGroup

类: SparklineGroup

Sheets.Sparklines.SparklineGroup

Table of contents

构造方法

属性

方法

构造方法

constructor

new SparklineGroup(type, setting)

迷你图组

参数

属性名 类型 说明
type SparklineType 迷你图的类型
setting SparklineSetting 迷你图组的设置

属性

setting

setting: SparklineSetting

迷你图设置


sparklineType

sparklineType: SparklineType

迷你图类型

方法

add

add(item): void

将迷你图添加到组中

代码示例

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

参数

属性名 类型 说明
item Sparkline 迷你图项

返回值

void


clone

clone(): SparklineGroup

克隆当前的迷你图组

代码示例

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

返回值

SparklineGroup

克隆的迷你图组


contains

contains(item): boolean

确定该组是否包含特定值

代码示例

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

参数

属性名 类型 说明
item Sparkline 要在组中定位的对象

返回值

boolean

如果在组中找到该项,返回true;否则为false


count

count(): number

迷你图组内部列表的计数

代码示例

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

组中的迷你图数量


dateAxisData

dateAxisData(value?): any

日期轴数据

代码示例

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

参数

属性名 类型 说明
value? Range 日期轴数据

返回值

any

如果未设置任何值,则返回日期轴数据 否则,返回undefined


dateAxisOrientation

dateAxisOrientation(value): any

日期轴方向

代码示例

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

参数

属性名 类型 说明
value DataOrientation 日期轴方向

返回值

any

如果未设置任何值,则返回日期轴方向;否则,返回未定义


remove

remove(item): Sparkline[]

从组中删除第一次出现的特定对象

代码示例

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

参数

属性名 类型 说明
item Sparkline 迷你图项

返回值

Sparkline[]

The GC.Spread.Sheets.Sparklines.Sparkline 数组