[]
        
(Showing Draft Content)

GC.Spread.Sheets.Slicers.SlicerStyleInfo

Class: SlicerStyleInfo

Sheets.Slicers.SlicerStyleInfo

Table of contents

Constructors

Methods

Constructors

constructor

new SlicerStyleInfo(backColor?, foreColor?, font?, borderLeft?, borderTop?, borderRight?, borderBottom?, textDecoration?, fontStyle?, fontWeight?, fontSize?, fontFamily?)

Represents slicer style information.

Parameters

Name Type
backColor? string
foreColor? string
font? string
borderLeft? SlicerBorder
borderTop? SlicerBorder
borderRight? SlicerBorder
borderBottom? SlicerBorder
textDecoration? TextDecorationType
fontStyle? string
fontWeight? string
fontSize? string
fontFamily? string

Methods

backColor

backColor(value?): any

Gets or sets the background color of the style information.

example

//This example sets the header backcolor.
//create a table
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 });
var activeSheet = spread.getActiveSheet();
var datas = [
    ["1", "NewYork", "1968/6/8", "80", "180"],
    ["4", "NewYork", "1972/7/3", "72", "168"],
    ["4", "NewYork", "1964/3/2", "71", "179"],
    ["5", "Washington", "1972/8/8","80", "171"],
    ["6", "Washington", "1986/2/2", "89", "161"],
    ["7", "Washington", "2012/2/15", "71", "240"]];
var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas);
var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"];
table.setColumnName(0, dataColumns[0]);
table.setColumnName(1, dataColumns[1]);
table.setColumnName(2, dataColumns[2]);
table.setColumnName(3, dataColumns[3]);
table.setColumnName(4, dataColumns[4]);
//style
var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo();
hstyle.backColor("red");
var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle();
style1.headerStyle(hstyle);
//add a slicer to the sheet and return the slicer instance.
var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name");
 //change the slicer properties.
slicer.position(new GC.Spread.Sheets.Point(100, 200));
slicer.style(style1);

Parameters

Name Type
value? string

Returns

any

If no value is set, returns the background color of the style information; otherwise, returns the slicer style information.


borderBottom

borderBottom(value?): any

Gets or sets the bottom border of the style information.

example

//This example sets a border style.
//create a table
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 });
var activeSheet = spread.getActiveSheet();
var datas = [
    ["1", "NewYork", "1968/6/8", "80", "180"],
    ["4", "NewYork", "1972/7/3", "72", "168"],
    ["4", "NewYork", "1964/3/2", "71", "179"],
    ["5", "Washington", "1972/8/8","80", "171"],
    ["6", "Washington", "1986/2/2", "89", "161"],
    ["7", "Washington", "2012/2/15", "71", "240"]];
var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas);
var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"];
table.setColumnName(0, dataColumns[0]);
table.setColumnName(1, dataColumns[1]);
table.setColumnName(2, dataColumns[2]);
table.setColumnName(3, dataColumns[3]);
table.setColumnName(4, dataColumns[4]);
//style
var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo();
hstyle.backColor("red");
hstyle.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green"));
var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle();
style1.hoveredSelectedItemWithDataStyle(hstyle);
//add a slicer to the sheet and return the slicer instance.
var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name");
//change the slicer properties.
slicer.position(new GC.Spread.Sheets.Point(100, 200));
slicer.style(style1);

Parameters

Name Type
value? SlicerBorder

Returns

any

If no value is set, returns the bottom border of the style information; otherwise, returns the slicer style information.


borderLeft

borderLeft(value?): any

Gets or sets the left border of the style information.

example

//This example sets the left border.
//create a table
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 });
var activeSheet = spread.getActiveSheet();
var datas = [
    ["1", "NewYork", "1968/6/8", "80", "180"],
    ["4", "NewYork", "1972/7/3", "72", "168"],
    ["4", "NewYork", "1964/3/2", "71", "179"],
    ["5", "Washington", "1972/8/8","80", "171"],
    ["6", "Washington", "1986/2/2", "89", "161"],
    ["7", "Washington", "2012/2/15", "71", "240"]];
var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas);
var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"];
table.setColumnName(0, dataColumns[0]);
table.setColumnName(1, dataColumns[1]);
table.setColumnName(2, dataColumns[2]);
table.setColumnName(3, dataColumns[3]);
table.setColumnName(4, dataColumns[4]);
//style
var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo();
hstyle.backColor("red");
hstyle.borderLeft(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green"));
hstyle.borderRight(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green"));
var hstyle1 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo();
hstyle1.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "dashed", "blue"));
var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle();
style1.hoveredSelectedItemWithDataStyle(hstyle);
style1.unSelectedItemWithDataStyle(hstyle1);
//add a slicer to the sheet and return the slicer instance.
var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name");
 //change the slicer properties.
slicer.position(new GC.Spread.Sheets.Point(100, 200));
slicer.style(style1);

Parameters

Name Type
value? SlicerBorder

Returns

any

If no value is set, returns the left border of the style information; otherwise, returns the slicer style information.


borderRight

borderRight(value?): any

Gets or sets the right border of the style information.

example

//This example sets the border.
//create a table
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 });
var activeSheet = spread.getActiveSheet();
var datas = [
    ["1", "NewYork", "1968/6/8", "80", "180"],
    ["4", "NewYork", "1972/7/3", "72", "168"],
    ["4", "NewYork", "1964/3/2", "71", "179"],
    ["5", "Washington", "1972/8/8","80", "171"],
    ["6", "Washington", "1986/2/2", "89", "161"],
    ["7", "Washington", "2012/2/15", "71", "240"]];
var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas);
var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"];
table.setColumnName(0, dataColumns[0]);
table.setColumnName(1, dataColumns[1]);
table.setColumnName(2, dataColumns[2]);
table.setColumnName(3, dataColumns[3]);
table.setColumnName(4, dataColumns[4]);
//style
var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo();
hstyle.backColor("red");
hstyle.borderLeft(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green"));
hstyle.borderRight(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green"));
var hstyle1 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo();
hstyle1.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "dashed", "blue"));
var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle();
style1.hoveredSelectedItemWithDataStyle(hstyle);
style1.unSelectedItemWithDataStyle(hstyle1);
//add a slicer to the sheet and return the slicer instance.
var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name");
 //change the slicer properties.
slicer.position(new GC.Spread.Sheets.Point(100, 200));
slicer.style(style1);

Parameters

Name Type
value? SlicerBorder

Returns

any

If no value is set, returns the right border of the style information; otherwise, returns the slicer style information.


borderTop

borderTop(value?): any

Gets or sets the top border of the style information.

example

//This example sets the border.
//create a table
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 });
var activeSheet = spread.getActiveSheet();
var datas = [
    ["1", "NewYork", "1968/6/8", "80", "180"],
    ["4", "NewYork", "1972/7/3", "72", "168"],
    ["4", "NewYork", "1964/3/2", "71", "179"],
    ["5", "Washington", "1972/8/8","80", "171"],
    ["6", "Washington", "1986/2/2", "89", "161"],
    ["7", "Washington", "2012/2/15", "71", "240"]];
var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas);
var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"];
table.setColumnName(0, dataColumns[0]);
table.setColumnName(1, dataColumns[1]);
table.setColumnName(2, dataColumns[2]);
table.setColumnName(3, dataColumns[3]);
table.setColumnName(4, dataColumns[4]);
//style
var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo();
hstyle.backColor("red");
hstyle.borderLeft(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green"));
hstyle.borderRight(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green"));
var hstyle1 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo();
hstyle1.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "dashed", "blue"));
var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle();
style1.hoveredSelectedItemWithDataStyle(hstyle);
style1.unSelectedItemWithDataStyle(hstyle1);
//add a slicer to the sheet and return the slicer instance.
var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name");
 //change the slicer properties.
slicer.position(new GC.Spread.Sheets.Point(100, 200));
slicer.style(style1);

Parameters

Name Type
value? SlicerBorder

Returns

any

If no value is set, returns the top border of the style information; otherwise, returns the slicer style information.


font

font(value?): any

Gets or sets the font of the style information.

example

//This example sets the font.
//create a table
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 });
var activeSheet = spread.getActiveSheet();
var datas = [
    ["1", "NewYork", "1968/6/8", "80", "180"],
    ["4", "NewYork", "1972/7/3", "72", "168"],
    ["4", "NewYork", "1964/3/2", "71", "179"],
    ["5", "Washington", "1972/8/8","80", "171"],
    ["6", "Washington", "1986/2/2", "89", "161"],
    ["7", "Washington", "2012/2/15", "71", "240"]];
var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas);
var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"];
table.setColumnName(0, dataColumns[0]);
table.setColumnName(1, dataColumns[1]);
table.setColumnName(2, dataColumns[2]);
table.setColumnName(3, dataColumns[3]);
table.setColumnName(4, dataColumns[4]);
//style
var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo();
hstyle.backColor("red");
hstyle.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green"));
hstyle.font("8pt Arial");
hstyle.textDecoration(GC.Spread.Sheets.TextDecorationType.underline);
var hstyle1 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo();
hstyle1.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "dashed", "blue"));
var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle();
style1.hoveredSelectedItemWithDataStyle(hstyle);
style1.unSelectedItemWithDataStyle(hstyle1);
//add a slicer to the sheet and return the slicer instance.
var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name");
 //change the slicer properties.
slicer.position(new GC.Spread.Sheets.Point(100, 200));
slicer.style(style1);

Parameters

Name Type
value? string

Returns

any

If no value is set, returns the font of the style information; otherwise, returns the slicer style information.


fontSize

fontSize(value?): any

Gets or sets the font family.

@param {string} [value] The font family of the style information.
@returns {string | GC.Spread.Sheets.Slicers.SlicerStyleInfo}  If no value is set, returns the font family of the style information; otherwise, returns the slicer style information.
@example

//This example sets a font family. //create a table var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); var activeSheet = spread.getActiveSheet(); var datas = [ ["1", "NewYork", "1968/6/8", "80", "180"], ["4", "NewYork", "1972/7/3", "72", "168"], ["4", "NewYork", "1964/3/2", "71", "179"], ["5", "Washington", "1972/8/8","80", "171"], ["6", "Washington", "1986/2/2", "89", "161"], ["7", "Washington", "2012/2/15", "71", "240"]]; var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; table.setColumnName(0, dataColumns[0]); table.setColumnName(1, dataColumns[1]); table.setColumnName(2, dataColumns[2]); table.setColumnName(3, dataColumns[3]); table.setColumnName(4, dataColumns[4]); //style var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); hstyle.fontFamily("Arial Black"); var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); style1.hoveredSelectedItemWithDataStyle(hstyle); //add a slicer to the sheet and return the slicer instance. var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); //change the slicer properties. slicer.position(new GC.Spread.Sheets.Point(100, 200)); slicer.style(style1);


#### Parameters

| Name | Type |
| :------ | :------ |
| `value?` | `string` |

#### Returns

`any`

___

### <a id="fontstyle" name="fontstyle"></a> fontStyle

▸ **fontStyle**(`value?`): `any`

Gets or sets the font style.

**`example`**

//This example sets a font style. //create a table var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); var activeSheet = spread.getActiveSheet(); var datas = [ ["1", "NewYork", "1968/6/8", "80", "180"], ["4", "NewYork", "1972/7/3", "72", "168"], ["4", "NewYork", "1964/3/2", "71", "179"], ["5", "Washington", "1972/8/8","80", "171"], ["6", "Washington", "1986/2/2", "89", "161"], ["7", "Washington", "2012/2/15", "71", "240"]]; var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; table.setColumnName(0, dataColumns[0]); table.setColumnName(1, dataColumns[1]); table.setColumnName(2, dataColumns[2]); table.setColumnName(3, dataColumns[3]); table.setColumnName(4, dataColumns[4]); //style var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); hstyle.fontStyle("italic"); var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); style1.hoveredSelectedItemWithDataStyle(hstyle); //add a slicer to the sheet and return the slicer instance. var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); //change the slicer properties. slicer.position(new GC.Spread.Sheets.Point(100, 200)); slicer.style(style1);


#### Parameters

| Name | Type |
| :------ | :------ |
| `value?` | `string` |

#### Returns

`any`

If no value is set, returns the font style of the style information; otherwise, returns the slicer style information.

___

### <a id="fontweight" name="fontweight"></a> fontWeight

▸ **fontWeight**(`value?`): `any`

Gets or sets the font weight.

**`example`**

//This example sets a font weight. //create a table var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); var activeSheet = spread.getActiveSheet(); var datas = [ ["1", "NewYork", "1968/6/8", "80", "180"], ["4", "NewYork", "1972/7/3", "72", "168"], ["4", "NewYork", "1964/3/2", "71", "179"], ["5", "Washington", "1972/8/8","80", "171"], ["6", "Washington", "1986/2/2", "89", "161"], ["7", "Washington", "2012/2/15", "71", "240"]]; var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; table.setColumnName(0, dataColumns[0]); table.setColumnName(1, dataColumns[1]); table.setColumnName(2, dataColumns[2]); table.setColumnName(3, dataColumns[3]); table.setColumnName(4, dataColumns[4]); //style var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); hstyle.fontWeight("bold"); var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); style1.hoveredSelectedItemWithDataStyle(hstyle); //add a slicer to the sheet and return the slicer instance. var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); //change the slicer properties. slicer.position(new GC.Spread.Sheets.Point(100, 200)); slicer.style(style1);


#### Parameters

| Name | Type |
| :------ | :------ |
| `value?` | `string` |

#### Returns

`any`

If no value is set, returns the font weight of the style information; otherwise, returns the slicer style information.

___

### <a id="forecolor" name="forecolor"></a> foreColor

▸ **foreColor**(`value?`): `any`

Gets or sets the foreground color of the style information.

**`example`**

//This example sets a header style for the slicer. //create a table var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); var activeSheet = spread.getActiveSheet(); var datas = [ ["1", "NewYork", "1968/6/8", "80", "180"], ["4", "NewYork", "1972/7/3", "72", "168"], ["4", "NewYork", "1964/3/2", "71", "179"], ["5", "Washington", "1972/8/8","80", "171"], ["6", "Washington", "1986/2/2", "89", "161"], ["7", "Washington", "2012/2/15", "71", "240"]]; var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; table.setColumnName(0, dataColumns[0]); table.setColumnName(1, dataColumns[1]); table.setColumnName(2, dataColumns[2]); table.setColumnName(3, dataColumns[3]); table.setColumnName(4, dataColumns[4]); //style var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); hstyle.foreColor("white"); hstyle.backColor("black"); var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); style1.headerStyle(hstyle); //add a slicer to the sheet and return the slicer instance. var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); //change the slicer properties. slicer.position(new GC.Spread.Sheets.Point(100, 200)); slicer.style(style1);


#### Parameters

| Name | Type |
| :------ | :------ |
| `value?` | `string` |

#### Returns

`any`

If no value is set, returns the foreground color of the style information; otherwise, returns the slicer style information.

___

### <a id="setborders" name="setborders"></a> setBorders

▸ **setBorders**(`value`): `void`

Sets every border of the style information.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `value` | [`SlicerBorder`](GC.Spread.Sheets.Slicers.SlicerBorder) | The border setting. |

#### Returns

`void`

___

### <a id="textdecoration" name="textdecoration"></a> textDecoration

▸ **textDecoration**(`value?`): `any`

Gets or sets the text decoration of the style information.

**`example`**

//This example underlines the text. //create a table var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); var activeSheet = spread.getActiveSheet(); var datas = [ ["1", "NewYork", "1968/6/8", "80", "180"], ["4", "NewYork", "1972/7/3", "72", "168"], ["4", "NewYork", "1964/3/2", "71", "179"], ["5", "Washington", "1972/8/8","80", "171"], ["6", "Washington", "1986/2/2", "89", "161"], ["7", "Washington", "2012/2/15", "71", "240"]]; var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; table.setColumnName(0, dataColumns[0]); table.setColumnName(1, dataColumns[1]); table.setColumnName(2, dataColumns[2]); table.setColumnName(3, dataColumns[3]); table.setColumnName(4, dataColumns[4]); //style var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); hstyle.backColor("red"); hstyle.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green")); hstyle.font("8pt Arial"); hstyle.textDecoration(GC.Spread.Sheets.TextDecorationType.underline); var hstyle1 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); hstyle1.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "dashed", "blue")); var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); style1.hoveredSelectedItemWithDataStyle(hstyle); style1.unSelectedItemWithDataStyle(hstyle1); //add a slicer to the sheet and return the slicer instance. var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); //change the slicer properties. slicer.position(new GC.Spread.Sheets.Point(100, 200)); slicer.style(style1);


#### Parameters

| Name | Type |
| :------ | :------ |
| `value?` | [`TextDecorationType`](../enums/GC.Spread.Sheets.TextDecorationType) |

#### Returns

`any`

If no value is set, returns the text decoration of the style information; otherwise, returns the slicer style information.