[]
        
(Showing Draft Content)

GC.Spread.Sheets.Range

Class: Range

Spread.Sheets.Range

Table of contents

Constructors

Properties

Methods

Constructors

constructor

• new Range(r, c, rc, cc)

Represents a range, which is described by the row index, column index, row count, and column count.

example

var style = new GC.Spread.Sheets.Style();
style.backColor = "red";
var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule);
rule.ranges([new GC.Spread.Sheets.Range(0,0,5,1)]);
rule.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between);
rule.style(style);
rule.value1(2);
rule.value2(100);
activeSheet.conditionalFormats.addRule(rule);
activeSheet.setValue(0,0,1,3);
activeSheet.setValue(1,0,45,3);

Parameters

Name Type Description
r number The row index.
c number The column index.
rc number The row count.
cc number The column count.

Properties

col

• col: number

The column index.

example

var cellrange = new GC.Spread.Sheets.Range();
cellrange.col = 0;
cellrange.row = 1;
cellrange.colCount = 1;
cellrange.rowCount = 8;
activeSheet.setValue(1, 0, 1);
activeSheet.setValue(2, 0, -2);
activeSheet.setValue(3, 0, -1);
activeSheet.setValue(4, 0, 6);
activeSheet.setValue(5, 0, 4);
activeSheet.setValue(6, 0, -4);
activeSheet.setValue(7, 0, 3);
activeSheet.setValue(8, 0, 8);
var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting();
setting.options.showMarkers = true;
activeSheet.setSparkline(13, 0, cellrange, GC.Spread.Sheets.Sparklines.DataOrientation.vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);

colCount

• colCount: number

The column count.

example

var cellrange = new GC.Spread.Sheets.Range();
cellrange.col = 0;
cellrange.row = 1;
cellrange.colCount = 1;
cellrange.rowCount = 8;
activeSheet.setValue(1, 0, 1);
activeSheet.setValue(2, 0, -2);
activeSheet.setValue(3, 0, -1);
activeSheet.setValue(4, 0, 6);
activeSheet.setValue(5, 0, 4);
activeSheet.setValue(6, 0, -4);
activeSheet.setValue(7, 0, 3);
activeSheet.setValue(8, 0, 8);
var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting();
setting.options.showMarkers = true;
activeSheet.setSparkline(13, 0, cellrange, GC.Spread.Sheets.Sparklines.DataOrientation.vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);

row

• row: number

The row index.

example

var cellrange = new GC.Spread.Sheets.Range();
cellrange.col = 0;
cellrange.row = 1;
cellrange.colCount = 1;
cellrange.rowCount = 8;
activeSheet.setValue(1, 0, 1);
activeSheet.setValue(2, 0, -2);
activeSheet.setValue(3, 0, -1);
activeSheet.setValue(4, 0, 6);
activeSheet.setValue(5, 0, 4);
activeSheet.setValue(6, 0, -4);
activeSheet.setValue(7, 0, 3);
activeSheet.setValue(8, 0, 8);
var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting();
setting.options.showMarkers = true;
activeSheet.setSparkline(13, 0, cellrange, GC.Spread.Sheets.Sparklines.DataOrientation.vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);

rowCount

• rowCount: number

The row count.

example

var cellrange = new GC.Spread.Sheets.Range();
cellrange.col = 0;
cellrange.row = 1;
cellrange.colCount = 1;
cellrange.rowCount = 8;
activeSheet.setValue(1, 0, 1);
activeSheet.setValue(2, 0, -2);
activeSheet.setValue(3, 0, -1);
activeSheet.setValue(4, 0, 6);
activeSheet.setValue(5, 0, 4);
activeSheet.setValue(6, 0, -4);
activeSheet.setValue(7, 0, 3);
activeSheet.setValue(8, 0, 8);
var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting();
setting.options.showMarkers = true;
activeSheet.setSparkline(13, 0, cellrange, GC.Spread.Sheets.Sparklines.DataOrientation.vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting);

Methods

contains

▸ contains(row, col, rowCount?, colCount?): boolean

Gets whether the current range contains the specified cell.

Parameters

Name Type Description
row number The row index.
col number The column index.
rowCount? number The row count.
colCount? number The column count.

Returns

boolean

true if the range contains the cell; otherwise, false.


containsRange

▸ containsRange(range): boolean

Gets whether the current range contains the specified range.

Parameters

Name Type Description
range Range The cell range.

Returns

boolean

true if the current range contains the specified cell range; otherwise, false.


equals

▸ equals(range): boolean

Gets whether the current range is equal to the specified range.

Parameters

Name Type Description
range Range The range to compare.

Returns

boolean

true if the current range is equal to the specified range; otherwise, false.


getIntersect

▸ getIntersect(range, maxRowCount, maxColumnCount): Range

Gets the intersection of two cell ranges.

Parameters

Name Type Description
range Range The cell range.
maxRowCount number The maximum row count.
maxColumnCount number The maximum column count.

Returns

Range

Returns null if there is no intersection, or the cell range of the intersection.


intersect

▸ intersect(row, col, rowCount, colCount): boolean

Gets whether the current range intersects with the one specified by the row and column index and the row and column count.

Parameters

Name Type Description
row number The row index.
col number The column index.
rowCount number The row count.
colCount number The column count.

Returns

boolean

true if the specified range intersects with the current range; otherwise false.


offset

▸ offset(x, y): Range

Offsets the location of the range by the specified coordinates.

Parameters

Name Type Description
x number The offset along the x-axis.
y number The offset along the y-axis.

Returns

Range

The new location.


union

▸ union(range): Range

Joins this range with the specified range as a union.

Parameters

Name Type Description
range Range The target range.

Returns

Range

Returns the union of the ranges.