@ -39,7 +39,7 @@ eg: options.data:
"luckysheet_conditionformat_save": {},//condition format
"frozen": {}, //freeze row and column configuration
"chart": [], //Chart configuration
"allowEdit": true, //is editble
"allowEdit": true, //is edita ble
"zoomRatio":1, // zoom ratio
},
{
@ -64,57 +64,57 @@ eg: options.data:
```
### name
- 类型 :String
- 默认值 :"Sheet1"
- 作用:工作表名称
- type :String
- default :"Sheet1"
- usage:the name of a sheet
------------
### color
- 类型 :String
- 默认值 :"##f20e0e"
- 作用:工作表颜色,工作表名称下方会有一条底部边框
- type :String
- default :"##f20e0e"
- usage:Sheet color, with a bottom border below the sheet name
------------
### index
- 类型 :Number
- 默认值 :0
- 作用:工作表索引,从0开始
- type :Number
- default :0
- usage:Worksheet index, starting from 0
------------
### status
- 类型 :Number
- 默认值 :1
- 作用: 激活状态,仅有一个激活状态的工作表,其他工作表为 0
- type :Number
- default :1
- usage:Active state, there is only one active worksheet which number will be 1 and the other worksheets are 0
------------
### order
- 类型 :Number
- 默认值 :0
- 作用: 工作表的索引,新增工作表时会递增,从0开始
- type :Number
- default :0
- usage: The index of the worksheets is starting from 0. it will increase when a worksheet is added.
------------
### hide
- 类型 :Number
- 默认值 :0
- 作用: 是否隐藏,`0`为不隐藏,`1`为隐藏
- type :Number
- default :0
- usage: is the sheet is hidden. `0` means not to hide, `1` means hide
------------
### row
- 类型 :Number
- 默认值 :36
- 作用: 单元格行数
- type :Number
- default :36
- usage: Number of cell rows
------------
### column
- 类型 :Number
- 默认值 :18
- 作用: 单元格列数
- type :Number
- default :18
- usage: The number of cell columns
------------
### celldata
- 类型 :Array
- 默认值 :[]
- 作用 : 原始单元格数据集,存储sheet中所有单元格中的值,是一个包含`{r:0,c:0,v:{m:"value",v:"value",ct: {fa: "General", t: "g"}}}`格式单元格信息的一维数组,只在初始化的时候使用。
- type :Array
- default :[]
- usage : 原始单元格数据集,存储sheet中所有单元格中的值,是一个包含`{r:0,c:0,v:{m:"value",v:"value",ct: {fa: "General", t: "g"}}}`格式单元格信息的一维数组,只在初始化的时候使用。
r代表行,c代表列,v代表该单元格的值,值可以是字符、数字或者对象。
@ -122,7 +122,7 @@ eg: options.data:
使用celldata初始化完表格后,数据转换为luckysheetfile中的字段[data](#data),如`luckysheetfile[i].data`,后续操作表格的数据更新,会更新到这个data字段中,celldata不再使用。
- 示例 :
- example :
```js
[{
"r": 0,
@ -146,17 +146,17 @@ eg: options.data:
------------
### config
- 类型 :Object
- 默认值 :{}
- 作用:表格行高、列宽、合并单元格、边框、隐藏行等设置
注意,config如果为空,必须为空对象`{}`,不能为字符串或者null
- type :Object
- default :{}
- usage:Table row height, column width, merged cells, borders, hidden rows and other settings
please be careful, config must be empty object `{}` , rather than empty string `""` or `null`
#### config.merge
- 类型 :Object
- 默认值 :{}
- 作用:合并单元格设置
- 示例 :
- type :Object
- default :{}
- usage:Merge cell settings
- example :
```js
{
"13_5": {
@ -179,13 +179,13 @@ eg: options.data:
}
}
```
对象中的`key`为`r + '_' + c`的拼接值,`value`为左上角单元格信息: r:行数,c:列数,rs:合并的行数,cs:合并的列数
The `key` in the object is the spliced value of `r +'_' + c` , and the `value` is the cell information in the upper left corner: r: number of rows, c: number of columns, rs: number of merged rows, cs: merge Number of columns
#### config.rowlen
- 类型 :Object
- 默认值 :{}
- 作用:每个单元格的行高
- 示例 :
- type :Object
- default :{}
- usage:The row height of each cell
- example :
```js
"rowlen": {
"0": 20,
@ -195,10 +195,10 @@ eg: options.data:
```
#### config.columnlen
- 类型 :Object
- 默认值 :{}
- 作用:每个单元格的列宽
- 示例 :
- type :Object
- default :{}
- usage:The column width of each cell
- example :
```js
"columnlen": {
"0": 97,
@ -208,12 +208,12 @@ eg: options.data:
```
#### config.rowhidden
- 类型 :Object
- 默认值 :{}
- 作用:隐藏行信息,格式为:`rowhidden[行数 ]: 0`,
- type :Object
- default :{}
- usage:Hidden row information, Rows:`rowhidden[Rows ]: 0`,
`key` 指定行数即可,`value`总是为`0`
- 示例 :
you should specify the number of rows by `key` ,`value` is always `0`
- example :
```js
"rowhidden": {
"30": 0,
@ -222,13 +222,13 @@ eg: options.data:
```
#### config.colhidden
- 类型 :Object
- 默认值 :{}
- 作用:隐藏列
- type :Object
- default :{}
- usage:Hidden row information, Rows:`rowhidden[Rows]: 0`,
格式为:`colhidden[列数]: 0`,
`key` 指定列数即可,`value`总是为`0`
- 示例 :
- example :
```js
"colhidden": {
"30": 0,
@ -237,10 +237,10 @@ eg: options.data:
```
#### config.borderInfo
- 类型 :Object
- 默认值 :{}
- 作用 :单元格的边框信息
- 示例 :
- type :Object
- default :{}
- usage :单元格的边框信息
- example :
```js
"borderInfo": [{
"rangeType": "cell",
@ -285,21 +285,21 @@ eg: options.data:
}]
}]
```
范围类型分单个单元格和选区两种情况
1. 选区 `rangeType: "range"`
The range type can be divided into single cell and selected area
1. selection `rangeType: "range"`
+ 边框类型 `borderType:"border-left" | "border-right" | "border-top" | "border-bottom" | "border-all" | "border-outside" | "border-inside" | "border-horizontal" | "border-vertical" | "border-none"` ,
+ 边框粗细 `style: 1 Thin | 2 Hair | 3 Dotted | 4 Dashed | 5 DashDot | 6 DashDotDot | 7 Double | 8 Medium | 9 MediumDashed | 10 MediumDashDot | 11 MediumDashDotDot | 12 SlantedDashDot | 13 Thick`
+ 边框颜色 `color: 16进制颜色值 `
+ 选区范围 `range: 行列信息数组 `
+ Border type `borderType:"border-left" | "border-right" | "border-top" | "border-bottom" | "border-all" | "border-outside" | "border-inside" | "border-horizontal" | "border-vertical" | "border-none"` ,
+ Border thickness `style: 1 Thin | 2 Hair | 3 Dotted | 4 Dashed | 5 DashDot | 6 DashDotDot | 7 Double | 8 Medium | 9 MediumDashed | 10 MediumDashDot | 11 MediumDashDotDot | 12 SlantedDashDot | 13 Thick`
+ Border color `color: Hexadecimal color value `
+ Selection area `range: Row and column information array `
2. 单个单元格 `rangeType:"cell"`
+ 单元格的行数和列数索引 `value.row_index: 数字,value.col_index: 数字 `
+ 四个边框对象 `value.l:左边框,value.r:右边框,value.t:上边框,value.b:下边框 `
+ 边框粗细 `value.l.style: 1 Thin | 2 Hair | 3 Dotted | 4 Dashed | 5 DashDot | 6 DashDotDot | 7 Double | 8 Medium | 9 MediumDashed | 10 MediumDashDot | 11 MediumDashDotDot | 12 SlantedDashDot | 13 Thick`
+ 边框颜色 `value.l.color: 16进制颜色值 `
2. Single cell `rangeType:"cell"`
+ Number of rows and columns `value.row_index: number,value.col_index: number `
+ Four border objects `value.l:Left border,value.r:Right border,value.t:Top border,value.b:Bottom border `
+ Border thickness `value.l.style: 1 Thin | 2 Hair | 3 Dotted | 4 Dashed | 5 DashDot | 6 DashDotDot | 7 Double | 8 Medium | 9 MediumDashed | 10 MediumDashDot | 11 MediumDashDotDot | 12 SlantedDashDot | 13 Thick`
+ Border color `value.l.color: Hexadecimal color value `
更多模板 :
templates :
+ ```js
{
@ -313,7 +313,7 @@ eg: options.data:
}]
}
```
表示设置范围为`{"row": [7, 8],"column": [2, 3]}`的选区,类型 为所有边框,边框粗细为`Dotted`,颜色为`"#0000ff"`
表示设置范围为`{"row": [7, 8],"column": [2, 3]}`的选区,type 为所有边框,边框粗细为`Dotted`,颜色为`"#0000ff"`
+ ```js
{
@ -344,22 +344,22 @@ eg: options.data:
------------
### scrollLeft
- 类型 :Number
- 默认值 :0
- 作用: 左右滚动条位置
- type :Number
- default :0
- usage: Left and right scroll bar position
------------
### scrollTop
- 类型 :Number
- 默认值 :0
- 作用: 上下滚动条位置
- type :Number
- default :0
- usage: Up and down scroll bar position
------------
### luckysheet_select_save
- 类型 :Array
- 默认值 :[]
- 作用: 选中的区域,支持多选,是一个包含多个选区对象的一维数组
- 示例 :
- type :Array
- default :[]
- usage: The selected area supports multiple selections and is a one-dimensional array containing multiple selection objects.
- example :
```js
[
{
@ -379,17 +379,17 @@ eg: options.data:
------------
### calcChain
- 类型 :Array
- 默认值 :[]
- 作用 : 公式链,用于公式所链接的单元格改变后,所有引用此单元格的公式都会联动刷新
- 示例 :
- type :Array
- default :[]
- usage : 公式链,用于公式所链接的单元格改变后,所有引用此单元格的公式都会联动刷新
- example :
```js
[{
"r": 6, //行数
"c": 3, //列数
"index": 1, //工作表 id
"r": 6, //the number of rows
"c": 3, //the number of columns
"index": 1, //sheet id
"func": [true, 23.75, "=AVERAGE(D3:D6)"], //公式信息,包含公式计算结果和公式字符串
"color": "w", //"w":采用深度优先算法 "b":普通计算
"color": "w", //"w":use Depth-First-Search "b":Normal search
"parent": null,
"chidren": {},
"times": 0
@ -407,16 +407,16 @@ eg: options.data:
------------
### isPivotTable
- 类型 :Boolean
- 默认值 :false
- 作用: 是否数据透视表
- type :Boolean
- default :false
- usage: is PivotTable
------------
### pivotTable
- 类型 :Object
- 默认值 :{}
- 作用: 数据透视表设置
- 示例 :
- type :Object
- default :{}
- usage: Pivot table settings
- example :
```js
{
"pivot_select_save": {
@ -457,10 +457,10 @@ eg: options.data:
------------
### filter_select
- 类型 :Object
- 默认值 :{}
- 作用: 筛选范围,一个选区,一个sheet只有一个筛选范围,类似`luckysheet_select_save`
- 示例 :
- type :Object
- default :{}
- usage: Filter range, a selection area, a sheet has only one filter range, similar to the `luckysheet_select_save`
- example :
```js
{
@ -471,20 +471,20 @@ eg: options.data:
------------
### filter
- 类型 :Object
- 默认值 :{}
- 作用: 筛选的具体设置
- 示例 :
- type :Object
- default :{}
- usage: filter settings
- example :
```js
{
"0": {
"caljs": { // 条件筛选类型
"caljs": { // filter type
"value": "cellnull",
"text": "Is empty",
"type": "0"
},
"rowhidden": { "3": 0, "4": 0 }, // 隐藏行
"optionstate": true, //是否开启配置
"rowhidden": { "3": 0, "4": 0 }, // the hidden rows
"optionstate": true, //is config active
"str": 2, // 范围,起始行
"edr": 6, // 范围,结束行
"cindex": 1, // 当前范围列索引
@ -506,10 +506,10 @@ eg: options.data:
------------
### luckysheet_alternateformat_save
- 类型 :Array
- 默认值 :[]
- 作用: 交替颜色配置
- 示例 :
- type :Array
- default :[]
- usage: Alternating color configuration
- example :
```js
[{
"cellrange": { //单元格范围
@ -566,25 +566,25 @@ eg: options.data:
------------
### luckysheet_alternateformat_save_modelCustom
- 类型 :Array
- 默认值 :[]
- 作用:自定义交替颜色,包含多个自定义交替颜色的配置
- 示例 :
- type :Array
- default :[]
- usage:Custom alternate colors, including multiple custom alternate colors configuration
- example :
```js
[{
"head": { //页眉颜色
"fc": "#6aa84f",
"bc": "#ffffff"
},
"one": { //第一种颜色
"one": { //The first color
"fc": "#000",
"bc": "#ffffff"
},
"two": { //第二种颜色
"two": { //The second color
"fc": "#000",
"bc": "#e5fbee"
},
"foot": { //页脚颜色
"foot": { //The footer color
"fc": "#000",
"bc": "#a5efcc"
}
@ -593,20 +593,20 @@ eg: options.data:
------------
### luckysheet_conditionformat_save
- 类型 :Array
- 默认值 :[]
- 作用: 条件格式配置信息,包含多个条件格式配置对象的一维数组,
- type :Array
- default :[]
- usage: Conditional format configuration information, a one-dimensional array containing multiple conditional format configuration objects,
type: "default": 突出显示单元格规则和项目选区规则,
type: "default": Highlight cell rules and project selection rules,
"dataBar":数据条,
"dataBar":Data bar,
"icons":图标集,
"icons":Icon set,
"colorGradation": 色阶
"colorGradation": Color scale
API中对此设置也有介绍 [API setRangeConditionalFormat](/zh/guide/api.html)
- 示例 :
You can get more detail in this API page [API setRangeConditionalFormat](/zh/guide/api.html)
- example :
```js
[
{
@ -621,7 +621,7 @@ eg: options.data:
"textColor": "#000000",
"cellColor": "#ff0000"
},
"conditionName": "betweenness", //类型
"conditionName": "betweenness", //type
"conditionRange": [ //条件值所在单元格
{
"row": [ 4, 4 ],
@ -681,16 +681,16 @@ eg: options.data:
------------
### frozen
- 类型 :Array
- 默认值 :[]
- 作用: 冻结行列设置,分为6种类型
1. "row": 冻结首行
2. "column": 冻结首列
3. "both": 冻结行列
- type :Array
- default :[]
- usage: the settings of freeze row and column which is divided into 6 types冻结行列设置,分为6种type
1. "row": the first freeze row
2. "column": the first freeze column
3. "both": the freeze rows and columns
4. "rangeRow": 冻结行到选区
5. "rangeColumn": 冻结列到选区
6. "rangeBoth": 冻结行列到选区
7. "cancel": 取消冻结
7. "cancel": cancel freeze
当设置冻结到选区的时候,需要设置开启冻结的单元格位置,格式为`{ row_focus:0, column_focus:0 }`,意为当前激活的单元格的行数和列数。
@ -698,7 +698,7 @@ eg: options.data:
注意一点,luckysheetfile中还有一个配置freezen,其中的freezenhorizontaldata仍然用作本地数据,但是不发给后台存储,只做本地调试。
- 示例 :
- example :
- 冻结首行
```json
{
@ -722,10 +722,10 @@ eg: options.data:
------------
### chart
- 类型 :Array
- 默认值 :[]
- 作用: 图表配置,参照chartMix的配置格式,允许只设置想要的图表属性,一个完整的配置案例如下。
- 示例 :
- type :Array
- default :[]
- usage: Chart configuration, plz refer to chartMix configuration. Allows you to set only the desired chart properties.
- example :
:::::: details
```json
{
@ -746,7 +746,7 @@ eg: options.data:
"defaultOption": {
"title": {
"show": false,
"text": "默认标题 ",
"text": "default title ",
"label": {
"fontSize": 12,
"color": "#333",
@ -1195,23 +1195,23 @@ eg: options.data:
------------
### allowEdit
- 类型 :Boolean
- 默认值 :true
- 作用: 此sheet页是否允许编辑
- type :Boolean
- default :true
- usage: is this sheet editable
------------
### zoomRatio
- 类型 :Number
- 默认值 :1
- 作用: 此sheet页的缩放比例,为0~1之间的二位小数数字。比如`0.1`、`0.56`
- type :Number
- default :1
- usage: the zoom ratio of a sheet, which is a two decimal digit between 0~1, like `0.1` 、`0.56`.
------------
## 调试信息
## debug information
初始化所需要的参数,会从简洁的角度出发来考虑设计,但是本地存储的参数则不同。
Luckysheet在初始化完成之后进行的一系列操作,会将更多本地参数存储在luckysheetfile中,作为本地使用的参数,实现一些类似Store数据中心的作用 。比如,freezen的参数格式也会变化。
Luckysheet在初始化完成之后进行的一系列操作,会将更多本地参数存储在luckysheetfile中,作为本地使用的参数,实现一些类似Store数据中心的usage 。比如,freezen的参数格式也会变化。
此时的luckysheetfile包含很多非初始化使用的本地参数,可用于调试代码、本地状态分析。如下展示了更丰富luckysheetfile信息,可通过方法 `luckysheet.getluckysheetfile()` 获得:
@ -1219,39 +1219,39 @@ Luckysheet在初始化完成之后进行的一系列操作,会将更多本地
```json
[
{
"name": "Cell", //工作表名称
"color": "", //工作表颜色
"index": 0, //工作表索引
"status": 1, //激活状态
"order": 0, //工作表的顺序
"hide": 0,//是否隐藏
"row": 36, //行数
"column": 18, //列数
"celldata": [], //初始化使用的单元格数据
"name": "Cell", //Worksheet name
"color": "", //Worksheet color
"index": 0, //Worksheet index
"status": 1, //Worksheet active status
"order": 0, //The order of the worksheet
"hide": 0,//Whether worksheet hide
"row": 36, //the number of rows in a sheet
"column": 18, //the number of columns in a sheet
"celldata": [], //Initial the cell data
"config": {
"merge":{}, //合并单元格
"rowlen":{}, //表格行高
"columnlen":{}, //表格列宽
"rowhidden":{}, //隐藏行
"colhidden":{}, //隐藏列
"borderInfo":{}, //边框
"merge":{}, //merged cells
"rowlen":{}, //Table row height
"columnlen":{}, //Table column width
"rowhidden":{}, //hidden rows
"colhidden":{}, //hidden columns
"borderInfo":{}, //borders
},
"scrollLeft": 0, //左右滚动条位置
"scrollTop": 315, //上下滚动条位置
"luckysheet_select_save": [], //选中的区域
"calcChain": [],//公式链
"isPivotTable":false,//是否数据透视表
"pivotTable":{},//数据透视表设置
"filter_select": {},//筛选范围
"filter": null,//筛选配置
"luckysheet_alternateformat_save": [], //交替颜色
"luckysheet_alternateformat_save_modelCustom": [], //自定义交替颜色
"luckysheet_conditionformat_save": {},//条件格式
"frozen": {}, //冻结行列配置
"scrollLeft": 0, //Left and right scroll bar position
"scrollTop": 315, //Up and down scroll bar position
"luckysheet_select_save": [], //selected area
"calcChain": [],//Formula chain
"isPivotTable":false,//Whether is pivot table
"pivotTable":{},//Pivot table settings
"filter_select": {},//Filter range
"filter": null,//Filter configuration
"luckysheet_alternateformat_save": [], //Alternate colors
"luckysheet_alternateformat_save_modelCustom": [], //Customize alternate colors
"luckysheet_conditionformat_save": {},//condition format
"frozen": {}, //freeze row and column configuration
"freezen": {}, //冻结行列的渲染数据存储
"chart": [], //图表配置
"allowEdit": true, //是否允许编辑
"zoomRatio":1, // 缩放比例
"chart": [], //Chart configuration
"allowEdit": true, //is editable
"zoomRatio":1, // zoom ratio
"visibledatarow": [], //所有行的位置
@ -1284,41 +1284,41 @@ Luckysheet在初始化完成之后进行的一系列操作,会将更多本地
:::
### visibledatarow
- 类型 :Number
- 默认值 :[]
- 作用: 所有行的位置信息,递增的行位置数据,初始化无需设 置
- type :Number
- default :[]
- usage: Position information of all rows, incremental row position data, No need to set up for initialization 置
------------
### visibledatacolumn
- 类型 :Number
- 默认值 :[]
- 作用: 所有列的位置信息,递增的列位置数据,初始化无需设置
- type :Number
- default :[]
- usage: Position information of all columns, incremental column position data, No need to set up for initialization
------------
### ch_width
- 类型 :Number
- 默认值 :2322
- 作用: 整个工作表区域的宽度(包含边界的灰色区域),初始化无需设置
- type :Number
- default :2322
- usage: The width of the entire worksheet area (the gray area including the border), No need to set up for initialization
------------
### rh_height
- 类型 :Number
- 默认值 :2322
- 作用: 整个工作表区域的高度(包含边界的灰色区域),初始化无需设置
- type :Number
- default :2322
- usage: The height of the entire worksheet area (the gray area containing the border), No need to set up for initialization
------------
### load
- 类型 :Number
- 默认值 :0
- 作用: 当前sheet是否加载过,内部标识,初始化无需设置
- type :Number
- default :0
- usage: Check whether the current sheet has been loaded, internal indicator, initialization does not need to be set
------------
### data
- 类型 :Array
- 默认值 :[]
- 作用: 初始化时从celldata转换而来,后续操作表格的数据更新,会更新到这个data字段中,初始化无需设置
- 示例 :
以下是一个二行二列的数据
- type :Array
- default :[]
- usage: conveted from celldata in initialization stage. `data` will have the update operation data.Initialization does not need to be set
- example :
Here is a two row, two column data
```json
[
[{