[]
• 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);
Name | Type | Description |
---|---|---|
r |
number |
The row index. |
c |
number |
The column index. |
rc |
number |
The row count. |
cc |
number |
The column count. |
• 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: 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: 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: 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);
▸ contains(row
, col
, rowCount?
, colCount?
): boolean
Gets whether the current range contains the specified cell.
Name | Type | Description |
---|---|---|
row |
number |
The row index. |
col |
number |
The column index. |
rowCount? |
number |
The row count. |
colCount? |
number |
The column count. |
boolean
true
if the range contains the cell; otherwise, false
.
▸ containsRange(range
): boolean
Gets whether the current range contains the specified range.
Name | Type | Description |
---|---|---|
range |
Range |
The cell range. |
boolean
true
if the current range contains the specified cell range; otherwise, false
.
▸ equals(range
): boolean
Gets whether the current range is equal to the specified range.
Name | Type | Description |
---|---|---|
range |
Range |
The range to compare. |
boolean
true
if the current range is equal to the specified range; otherwise, false
.
▸ getIntersect(range
, maxRowCount
, maxColumnCount
): Range
Gets the intersection of two cell ranges.
Name | Type | Description |
---|---|---|
range |
Range |
The cell range. |
maxRowCount |
number |
The maximum row count. |
maxColumnCount |
number |
The maximum column count. |
Returns null if there is no intersection, or the cell range of the intersection.
▸ 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.
Name | Type | Description |
---|---|---|
row |
number |
The row index. |
col |
number |
The column index. |
rowCount |
number |
The row count. |
colCount |
number |
The column count. |
boolean
true
if the specified range intersects with the current range; otherwise false
.
▸ offset(x
, y
): Range
Offsets the location of the range by the specified coordinates.
Name | Type | Description |
---|---|---|
x |
number |
The offset along the x-axis. |
y |
number |
The offset along the y-axis. |
The new location.
▸ union(range
): Range
Joins this range with the specified range as a union.
Name | Type | Description |
---|---|---|
range |
Range |
The target range. |
Returns the union of the ranges.