图表配置
更新时间:2022-11-15
折线图参数
注: frontendId: "FKEVCVGPBXVJX", // 用来确保唯一性,下面的排序中也需要用,id 字段可不唯一(因为可能会重复加同一个字段),frontendId 在后端 SQL 生成中也很重要作为字段的 AS 别名(生成方式:'F' + (+new Date()).toString(36) + Math.floor(Math.random() 10000000 (massive ? 10000 : 1).toString(36).toUpperCase())
Javascript
1{
2 dataConfig: {
3 categoriesSort: "default", // X轴数据排序(default默认、asc从小到大、desc从大到小)
4 doubleY: false, // 开启双Y轴
5 dataModel: {
6 limit: 5, // 查询结果行数
7 x: [ // X轴/类别轴(只允许拖入维度)
8 {
9 dataType: "string", // 数据类型 string字符、int整数、float小数、date日期、timestamp时间戳、datetime日期时间
10 frontendId: "FKEVCVGPBXVJX", // 用来确保唯一性,下面的排序中也需要用,id字段可能不唯一(因为可能会重复加同一个字段),frontendId在后端SQL生成中也很重要作为字段的AS别名(生成方式:'F' + (+new Date()).toString(36) + Math.floor(Math.random() * 10000000 * (massive ? 10000 : 1)).toString(36).toUpperCase())
11 id: "SG013D40CAE7C5C32C", // 维度的id
12 type: "d" // 类型 (d维度、m度量)
13 }
14 ],
15 y: [ // Y轴/值轴(只允许拖入度量)
16 {
17 dataType: "int", // 数据类型 string字符、int整数、float小数、date日期、timestamp时间戳、datetime日期时间
18 frontendId: "FKEVCVKPZ3EVF2", // 同上
19 id: "SGC8D822BA1D2765B2", // 度量id
20 type: "m" // 类型 (d维度、m度量)
21 }
22 ],
23 color: [ // 颜色图例(只允许拖入维度)
24 {
25 dataType: "string",
26 frontendId: "FKEWHX7HF2I5MX",
27 id: "SG73F45C81D02A170D",
28 type: "d"
29 }
30 ],
31 chartCondition: [ // 单图表过滤条件
32 {
33 alias: "产品名称", // 别名
34 dataType: "string", // 同上
35 frontendId: "FKFESO3F83IL9Q", // 同上
36 id: "SG013D40CAE7C5C32C", // 维度的id
37 type: "d" // 类型(单图表过滤条件仅支持维度(type:d))
38 }
39 ],
40 filters: {} // 数据筛选器
41 }
42 },
43 config: {}, // 图表配置
44 drillDown: [], // 下钻配置
45 drillDownOpen: false, // 是否开启下钻
46 dataModelHash: "mld_ada15-9c2ccod1-46jxow4", // 数据模型hash
47 dataType: "dataModel", // 数据绑定方式(dataModel数据模型、sql SQL建模、api API拉取、json静态JSON)
48 frontendId: "kevcv5e71kelb",
49 hash: "", // 图表hash
50 name: "折线图", // 图表名称
51 remark: "", // 图表介绍
52 reportHash: "r_ada15-21e1c57v-8kngm9", // 报表hash
53 type: "line", // 图表类型
54 width: 4, // 图表宽度 (1-12)
55 height: 300, // 图表高度
56 top: 0, // 图表顶部位置
57 left: 0, // 图表左侧位置
58 right: 0, // 图表右侧位置
59 titleAlign: 'left', // 图表标题居中方式(left左对齐,center居中对齐,right右对齐)
60 hideTitle: false // 隐藏标题
61}
参数名 | 类型 | 必填 | 描述 | 默认值 | 参考值 |
---|---|---|---|---|---|
dataModelHash | String | 是 | 数据模型 hash | - | mld_ada15-9c2ccod1-46jxow4 |
dataType | String | 是 | 数据绑定方式(dataModel 数据模型、sql SQL 建模、api API 拉取、json 静态 JSON) | dataModel | dataModel |
frontendId | String | 是 | 用来确保唯一性,下面的排序中也需要用,id 字段可能不唯一(因为可能会重复加同一个字段),frontendId 在后端 SQL 生成中也很重要作为字段的 AS 别名(生成方式:'F' + (+new Date()).toString(36) + Math.floor(Math.random() 10000000 (massive ? 10000 : 1)).toString(36).toUpperCase()) | - | - |
hash | String | 是 | 图表 hash | - | - |
name | String | 是 | 图表名称 | - | - |
remark | String | 是 | 图表介绍 | - | - |
reportHash | String | 是 | 报表 hash | - | r_ada15-21e1c57v-8kngm9 |
type | String | 是 | 图表类型 | - | line |
dataConfig | Object | 是 | 图表数据配置(详细描述见下方) | - | {} |
dataConfig 图表数据配置
参数名 | 类型 | 必填 | 描述 | 默认值 | 参考值 |
---|---|---|---|---|---|
categoriesSort | String | 是 | X 轴数据排序(default 默认、asc 从小到大、desc 从大到小) | default | default |
doubleY | Boolean | 是 | 开启双 Y 轴 | false | false |
dataModel | Object | 是 | 数据模型配置(详细描述见下方) | - | - |
dataModel 图表数据模型配置
参数名 | 类型 | 必填 | 描述 | 默认值 | 参考值 |
---|---|---|---|---|---|
limit | Number | 是 | 查询结果行数 | - | 1000 |
x | Array | 是 | X 轴/类别轴(只允许拖入维度)(详细描述见下方) | [] | - |
y | Array | 是 | Y 轴/值轴(只允许拖入度量)(详细描述见下方) | [] | - |
color | Array | 是 | 颜色图例(只允许拖入维度)(详细描述见下方) | [] | - |
filters | Object | 否 | 数据筛选器(详细描述见数据筛选) | - | - |
x/y/color 配置
参数名 | 类型 | 必填 | 描述 | 默认值 | 参考值 |
---|---|---|---|---|---|
dataType | String | 是 | 数据类型 string 字符、int 整数、float 小数、date 日期、timestamp 时间戳、datetime 日期时间 | - | string |
frontendId | String | 是 | 用来确保唯一性,下面的排序中也需要用,id 字段可能不唯一(因为可能会重复加同一个字段),frontendId 在后端 SQL 生成中也很重要作为字段的 AS 别名(生成方式:'F' + (+new Date()).toString(36) + Math.floor(Math.random() 10000000 (massive ? 10000 : 1)).toString(36).toUpperCase()) | - | - |
id | String | 是 | 度量/维度 id | - | - |
type | String | 是 | 类型 (d 维度、m 度量) | - | d |
柱图参数
Javascript
1// 数据模型方式
2{
3 dataConfig: {
4 categoriesSort: "default", // X轴数据排序(default默认、asc从小到大、desc从大到小)
5 dataModel: {
6 limit: 5, // 查询结果行数
7 x: [ // X轴/类别轴(只允许拖入维度)
8 {
9 dataType: "string", // 数据类型 string字符、int整数、float小数、date日期、timestamp时间戳、datetime日期时间
10 frontendId: "FKEVCVGPBXVJX", // 用来确保唯一性,下面的排序中也需要用,id字段可能不唯一(因为可能会重复加同一个字段),frontendId在后端SQL生成中也很重要作为字段的AS别名(生成方式:'F' + (+new Date()).toString(36) + Math.floor(Math.random() * 10000000 * (massive ? 10000 : 1)).toString(36).toUpperCase())
11 id: "SG013D40CAE7C5C32C", // 维度的id
12 type: "d" // 类型 (d维度、m度量)
13 }
14 ],
15 y: [ // Y轴/值轴(只允许拖入度量)
16 {
17 dataType: "int", // 数据类型 string字符、int整数、float小数、date日期、timestamp时间戳、datetime日期时间
18 frontendId: "FKEVCVKPZ3EVF2", // 同上
19 id: "SGC8D822BA1D2765B2", // 度量id
20 type: "m" // 类型 (d维度、m度量)
21 }
22 ],
23 color: [ // 颜色图例(只允许拖入维度)
24 {
25 dataType: "string",
26 frontendId: "FKEWHX7HF2I5MX",
27 id: "SG73F45C81D02A170D",
28 type: "d"
29 }
30 ],
31 filters: {} // 数据筛选器
32 }
33 },
34 config: {}, // 图表配置
35 drillDown: [], // 下钻配置
36 drillDownOpen: false, // 是否开启下钻
37 dataType: "dataModel", // 数据绑定方式(dataModel数据模型、sql SQL建模、api API拉取、json静态JSON)
38 frontendId: "kewj6c6v1b8ab",
39 dataModelHash: "mld_ada15-9c2ccod1-46jxow4", // 数据模型hash
40 reportHash: "r_ada15-21e1c57v-8kngm9", // 报表hash
41 type: "bar", // 图表类型
42 width: 4, // 图表宽度 (1-12)
43 height: 300, // 图表高度
44 top: 0, // 图表顶部位置
45 left: 0, // 图表左侧位置
46 right: 0, // 图表右侧位置
47 titleAlign: 'left', // 图表标题居中方式(left左对齐,center居中对齐,right右对齐)
48 hideTitle: false // 隐藏标题
49}
参数名 | 类型 | 必填 | 描述 | 默认值 | 参考值 |
---|---|---|---|---|---|
dataModelHash | String | 是 | 数据模型 hash | - | mld_ada15-9c2ccod1-46jxow4 |
dataType | String | 是 | 数据绑定方式(dataModel 数据模型、sql SQL 建模、api API 拉取、json 静态 JSON) | dataModel | dataModel |
frontendId | String | 是 | 用来确保唯一性,下面的排序中也需要用,id 字段可能不唯一(因为可能会重复加同一个字段),frontendId 在后端 SQL 生成中也很重要作为字段的 AS 别名(生成方式:'F' + (+new Date()).toString(36) + Math.floor(Math.random() 10000000 (massive ? 10000 : 1)).toString(36).toUpperCase()) | - | - |
hash | String | 是 | 图表 hash | - | - |
name | String | 是 | 图表名称 | - | - |
remark | String | 是 | 图表介绍 | - | - |
reportHash | String | 是 | 报表 hash | - | r_ada15-21e1c57v-8kngm9 |
type | String | 是 | 图表类型 | - | line |
dataConfig | Object | 是 | 图表数据配置(详细描述见下方) | - | {} |
dataConfig 图表数据配置
参数名 | 类型 | 必填 | 描述 | 默认值 | 参考值 |
---|---|---|---|---|---|
categoriesSort | String | 是 | X 轴数据排序(default 默认、asc 从小到大、desc 从大到小) | default | default |
dataModel | Object | 是 | 数据模型配置(详细描述见下方) | - | - |
dataModel 图表数据模型配置
参数名 | 类型 | 必填 | 描述 | 默认值 | 参考值 |
---|---|---|---|---|---|
limit | Number | 是 | 查询结果行数 | - | 1000 |
x | Array | 是 | X 轴/类别轴(只允许拖入维度)(详细描述见下方) | [] | - |
y | Array | 是 | Y 轴/值轴(只允许拖入度量)(详细描述见下方) | [] | - |
color | Array | 是 | 颜色图例(只允许拖入维度)(详细描述见下方) | [] | - |
filters | Object | 否 | 数据筛选器(详细描述见数据筛选) | - | - |
x/y/color 配置
参数名 | 类型 | 必填 | 描述 | 默认值 | 参考值 |
---|---|---|---|---|---|
dataType | String | 是 | 数据类型 string 字符、int 整数、float 小数、date 日期、timestamp 时间戳、datetime 日期时间 | - | string |
frontendId | String | 是 | 用来确保唯一性,下面的排序中也需要用,id 字段可能不唯一(因为可能会重复加同一个字段),frontendId 在后端 SQL 生成中也很重要作为字段的 AS 别名(生成方式:'F' + (+new Date()).toString(36) + Math.floor(Math.random() 10000000 (massive ? 10000 : 1)).toString(36).toUpperCase()) | - | - |
id | String | 是 | 度量/维度 id | - | - |
type | String | 是 | 类型 (d 维度、m 度量) | - | d |
表格参数
Javascript
1{
2 dataConfig: {
3 dataModel: {
4 limit: 5, // 查询结果行数
5 // 普通表格配置
6 x: [ // 列数据(可以拖入度量或者维度作为列数据)
7 {
8 dataType: "string", // 数据类型 string字符、int整数、float小数、date日期、timestamp时间戳、datetime日期时间
9 frontendId: "FKEVCVGPBXVJX", // 用来确保唯一性,下面的排序中也需要用,id字段可能不唯一(因为可能会重复加同一个字段),frontendId在后端SQL生成中也很重要作为字段的AS别名(生成方式:'F' + (+new Date()).toString(36) + Math.floor(Math.random() * 10000000 * (massive ? 10000 : 1)).toString(36).toUpperCase())
10 id: "SG013D40CAE7C5C32C", // 维度的id
11 type: "d" // 类型 (d维度、m度量)
12 }
13 ],
14 // 交叉透视表配置
15 value: [ // 指标数据(只允许放置度量数据,可以放置<=5个)
16 {
17 dataType: "int",
18 frontendId: "FKEWJPQF5QE86",
19 id: "SGC8D822BA1D2765B2",
20 type: "m"
21 }
22 ],
23 x2: [ // 列数据(只允许放置维度数据)
24 {
25 dataType: "string",
26 frontendId: "FKEWJPIYP3WRKF",
27 id: "SG013D40CAE7C5C32C",
28 type: "d"
29 }
30 ],
31 y: [ // 行数据(只允许放置维度数据)
32 {
33 dataType: "string",
34 frontendId: "FKEWJPIYP3WRKF",
35 id: "SG013D40CAE7C5C32C",
36 type: "d"
37 }
38 ],
39 filters: {} // 数据筛选器
40 },
41 tableType: "normal" // 表格类型(normal普通表格、crossPivot较差透视表)
42 },
43 config: {}, // 图表配置
44 drillDown: [], // 下钻配置
45 drillDownOpen: false, // 是否开启下钻
46 dataType: "dataModel", // 数据绑定方式(dataModel数据模型、sql SQL建模、api API拉取、json静态JSON)
47 frontendId: "kewj6c6v1b8ab",
48 dataModelHash: "mld_ada15-9c2ccod1-46jxow4", // 数据模型hash
49 reportHash: "r_ada15-21e1c57v-8kngm9", // 报表hash
50 type: "table", // 图表类型
51 width: 4, // 图表宽度 (1-12)
52 height: 300, // 图表高度
53 top: 0, // 图表顶部位置
54 left: 0, // 图表左侧位置
55 right: 0, // 图表右侧位置
56 titleAlign: 'left', // 图表标题居中方式(left左对齐,center居中对齐,right右对齐)
57 hideTitle: false // 隐藏标题
58}
参数名 | 类型 | 必填 | 描述 | 默认值 | 参考值 |
---|---|---|---|---|---|
dataModelHash | String | 是 | 数据模型 hash | - | mld_ada15-9c2ccod1-46jxow4 |
dataType | String | 是 | 数据绑定方式(dataModel 数据模型、sql SQL 建模、api API 拉取、json 静态 JSON) | dataModel | dataModel |
frontendId | String | 是 | 用来确保唯一性,下面的排序中也需要用,id 字段可能不唯一(因为可能会重复加同一个字段),frontendId 在后端 SQL 生成中也很重要作为字段的 AS 别名(生成方式:'F' + (+new Date()).toString(36) + Math.floor(Math.random() 10000000 (massive ? 10000 : 1)).toString(36).toUpperCase()) | - | - |
hash | String | 是 | 图表 hash | - | - |
name | String | 是 | 图表名称 | - | - |
remark | String | 是 | 图表介绍 | - | - |
reportHash | String | 是 | 报表 hash | - | r_ada15-21e1c57v-8kngm9 |
type | String | 是 | 图表类型 | - | line |
dataConfig | Object | 是 | 图表数据配置(详细描述见下方) | - | {} |
dataConfig 图表数据配置
参数名 | 类型 | 必填 | 描述 | 默认值 | 参考值 |
---|---|---|---|---|---|
tableType | String | 是 | 表格类型(normal 普通表格、crossPivot 较差透视表) | - | normal/crossPivot |
dataModel | Object | 是 | 数据模型配置(详细描述见下方) | - | - |
dataModel 图表数据模型配置
参数名 | 类型 | 必填 | 描述 | 默认值 | 参考值 |
---|---|---|---|---|---|
limit | Number | 是 | 查询结果行数 | - | 1000 |
x | Array | 是 | 列数据(可以拖入度量或者维度作为列数据)(详细描述见下方) | [] | - |
y | Array | 是 | 行数据(只允许放置维度数据)(详细描述见下方) | [] | - |
x2 | Array | 是 | 列数据(只允许放置维度数据)(详细描述见下方) | [] | - |
value | Array | 是 | 指标数据(只允许放置度量数据,可以放置<=5 个)(详细描述见下方) | [] | - |
filters | Object | 否 | 数据筛选器(详细描述见数据筛选) | - | - |
x/y/x2/value 配置
参数名 | 类型 | 必填 | 描述 | 默认值 | 参考值 |
---|---|---|---|---|---|
dataType | String | 是 | 数据类型 string 字符、int 整数、float 小数、date 日期、timestamp 时间戳、datetime 日期时间 | - | string |
frontendId | String | 是 | 用来确保唯一性,下面的排序中也需要用,id 字段可能不唯一(因为可能会重复加同一个字段),frontendId 在后端 SQL 生成中也很重要作为字段的 AS 别名(生成方式:'F' + (+new Date()).toString(36) + Math.floor(Math.random() 10000000 (massive ? 10000 : 1)).toString(36).toUpperCase()) | - | - |
id | String | 是 | 度量/维度 id | - | - |
type | String | 是 | 类型 (d 维度、m 度量) | - | d |