[]
Sheets.Sparklines.SparklineGroup
• new SparklineGroup(type
, setting
)
迷你图组
属性名 | 类型 | 说明 |
---|---|---|
type |
SparklineType |
迷你图的类型 |
setting |
SparklineSetting |
迷你图组的设置 |
• setting: SparklineSetting
迷你图设置
• sparklineType: SparklineType
迷你图类型
▸ 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(): 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();
克隆的迷你图组
▸ 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(): 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(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(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(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 |
迷你图项 |
The GC.Spread.Sheets.Sparklines.Sparkline 数组