Эх сурвалжийг харах

fix:环图添加间距大小配置

liu.shiyi 1 жил өмнө
parent
commit
0552e6bad1

+ 34 - 3
data-room-ui/packages/G2Plots/进度图/仪表盘.js

@@ -1,6 +1,6 @@
 import fontList from 'data-room-ui/js/utils/fontList'
 import fontList from 'data-room-ui/js/utils/fontList'
 // 配置版本号
 // 配置版本号
-const version = '2023101401'
+const version = '2023101402'
 // 分类
 // 分类
 const category = 'Gauge'
 const category = 'Gauge'
 // 标题
 // 标题
@@ -138,6 +138,32 @@ const setting = [
     tabName: 'custom',
     tabName: 'custom',
     groupName: 'graph'
     groupName: 'graph'
   },
   },
+  {
+    label: '标签间距大小',
+    // 设置组件类型
+    type: 'inputNumber',
+    // 字段
+    field: 'statistic_content_offsetY',
+    // 对应options中的字段
+    optionField: 'statistic.content.offsetY',
+    value: -30,
+    min:-100,
+    tabName: 'custom',
+    groupName: 'graph'
+  },
+  {
+    label: '指标间距大小',
+    // 设置组件类型
+    type: 'inputNumber',
+    // 字段
+    field: 'statistic_title_offsetY',
+    // 对应options中的字段
+    optionField: 'statistic.title.offsetY',
+    value: 0,
+    min:-100,
+    tabName: 'custom',
+    groupName: 'graph'
+  }
   // 图例 legend
   // 图例 legend
   // 边距 padding
   // 边距 padding
 ]
 ]
@@ -146,6 +172,9 @@ const data = [
     percent: 0.75
     percent: 0.75
   }
   }
 ]
 ]
+// 配置处理脚本
+const optionHandler =''
+
 // 数据处理脚本
 // 数据处理脚本
 const dataHandler = '// 取返回数据列表的第一项指标值\noption.percent = data[0][setting.filter(settingItem=>settingItem.field === \'percent\')[0].value]'
 const dataHandler = '// 取返回数据列表的第一项指标值\noption.percent = data[0][setting.filter(settingItem=>settingItem.field === \'percent\')[0].value]'
 
 
@@ -185,7 +214,7 @@ const option = {
   // },
   // },
   statistic: {
   statistic: {
     title: {
     title: {
-      offsetY: -20,
+      offsetY: 0,
       style: {
       style: {
         fontSize: 20,
         fontSize: 20,
         lineHeight: 2,
         lineHeight: 2,
@@ -195,6 +224,7 @@ const option = {
       formatter: ({ percent }) => `${(percent * 100).toFixed(0)}%`
       formatter: ({ percent }) => `${(percent * 100).toFixed(0)}%`
     },
     },
     content: {
     content: {
+      offsetY: -30,
       content: '占比',
       content: '占比',
       style: {
       style: {
         fontSize: 20,
         fontSize: 20,
@@ -212,5 +242,6 @@ export default {
   name,
   name,
   option,
   option,
   setting,
   setting,
-  dataHandler
+  dataHandler,
+  optionHandler
 }
 }

+ 29 - 15
data-room-ui/packages/G2Plots/进度图/进度仪表盘.js

@@ -1,6 +1,6 @@
 import fontList from 'data-room-ui/js/utils/fontList'
 import fontList from 'data-room-ui/js/utils/fontList'
 // 配置版本号
 // 配置版本号
-const version = '2023101401'
+const version = '2023101402'
 // 分类
 // 分类
 const category = 'Gauge'
 const category = 'Gauge'
 // 标题
 // 标题
@@ -78,19 +78,6 @@ const setting = [
     options: fontList,
     options: fontList,
     groupName: 'graph'
     groupName: 'graph'
   },
   },
-  {
-    label: '指标位置',
-    // 设置组件类型
-    type: 'inputNumber',
-    // 字段
-    field: 'statistic_title_offsetY',
-    // 对应options中的字段
-    optionField: 'statistic.title.offsetY',
-    value: -36,
-    min: -100,
-    tabName: 'custom',
-    groupName: 'graph'
-  },
   {
   {
     label: '标签内容',
     label: '标签内容',
     // 设置组件类型
     // 设置组件类型
@@ -126,6 +113,32 @@ const setting = [
     value: 20,
     value: 20,
     tabName: 'custom',
     tabName: 'custom',
     groupName: 'graph'
     groupName: 'graph'
+  },
+  {
+    label: '标签间距大小',
+    // 设置组件类型
+    type: 'inputNumber',
+    // 字段
+    field: 'statistic_content_offsetY',
+    // 对应options中的字段
+    optionField: 'statistic.content.offsetY',
+    value: -30,
+    min:-100,
+    tabName: 'custom',
+    groupName: 'graph'
+  },
+  {
+    label: '指标间距大小',
+    // 设置组件类型
+    type: 'inputNumber',
+    // 字段
+    field: 'statistic_title_offsetY',
+    // 对应options中的字段
+    optionField: 'statistic.title.offsetY',
+    value: 0,
+    min:-100,
+    tabName: 'custom',
+    groupName: 'graph'
   }
   }
   // 边距 padding
   // 边距 padding
 ]
 ]
@@ -151,7 +164,7 @@ const option = {
   indicator: null,
   indicator: null,
   statistic: {
   statistic: {
     title: {
     title: {
-      offsetY: -36,
+      offsetY: 0,
       style: {
       style: {
         fontSize: 20,
         fontSize: 20,
         lineHeight: 2,
         lineHeight: 2,
@@ -161,6 +174,7 @@ const option = {
       formatter: ({ percent }) => `${(percent * 100).toFixed(0)}%`
       formatter: ({ percent }) => `${(percent * 100).toFixed(0)}%`
     },
     },
     content: {
     content: {
+      offsetY: -30,
       content: '占比',
       content: '占比',
       style: {
       style: {
         fontSize: 20,
         fontSize: 20,

+ 18 - 4
data-room-ui/packages/G2Plots/进度图/进度环图.js

@@ -1,6 +1,6 @@
 import fontList from 'data-room-ui/js/utils/fontList'
 import fontList from 'data-room-ui/js/utils/fontList'
 // 配置版本号
 // 配置版本号
-const version = '2023101401'
+const version = '2023101402'
 // 分类
 // 分类
 const category = 'RingProgress'
 const category = 'RingProgress'
 // 标题
 // 标题
@@ -140,18 +140,32 @@ const setting = [
     groupName: 'graph'
     groupName: 'graph'
   },
   },
   {
   {
-    label: '指标位置',
+    label: '标签间距大小',
     // 设置组件类型
     // 设置组件类型
     type: 'inputNumber',
     type: 'inputNumber',
     // 字段
     // 字段
-    field: 'statistic_content_style_offsetY',
+    field: 'statistic_title_offsetY',
+    // 对应options中的字段
+    optionField: 'statistic.title.offsetY',
+    value: 0,
+    min:-100,
+    tabName: 'custom',
+    groupName: 'graph'
+  },
+  {
+    label: '指标间距大小',
+    // 设置组件类型
+    type: 'inputNumber',
+    // 字段
+    field: 'statistic_content_offsetY',
     // 对应options中的字段
     // 对应options中的字段
     optionField: 'statistic.content.offsetY',
     optionField: 'statistic.content.offsetY',
     value: 0,
     value: 0,
-    min: -100,
+    min:-100,
     tabName: 'custom',
     tabName: 'custom',
     groupName: 'graph'
     groupName: 'graph'
   }
   }
+
   // 边距 padding
   // 边距 padding
 ]
 ]
 
 

+ 29 - 1
data-room-ui/packages/G2Plots/饼图/基础环图.js

@@ -1,6 +1,6 @@
 import fontList from 'data-room-ui/js/utils/fontList'
 import fontList from 'data-room-ui/js/utils/fontList'
 // 配置版本号
 // 配置版本号
-const version = '2023101401'
+const version = '2023101402'
 // 分类
 // 分类
 const category = 'Pie'
 const category = 'Pie'
 // 标题
 // 标题
@@ -215,6 +215,32 @@ const setting = [
     options: fontList,
     options: fontList,
     groupName: 'graph'
     groupName: 'graph'
   },
   },
+  {
+    label: '标签间距大小',
+    // 设置组件类型
+    type: 'inputNumber',
+    // 字段
+    field: 'statistic_title_offsetY',
+    // 对应options中的字段
+    optionField: 'statistic.title.offsetY',
+    value: 0,
+    min:-100,
+    tabName: 'custom',
+    groupName: 'graph'
+  },
+  {
+    label: '指标间距大小',
+    // 设置组件类型
+    type: 'inputNumber',
+    // 字段
+    field: 'statistic_content_offsetY',
+    // 对应options中的字段
+    optionField: 'statistic.content.offsetY',
+    value: 0,
+    min:-100,
+    tabName: 'custom',
+    groupName: 'graph'
+  },
   {
   {
     label: '外环半径',
     label: '外环半径',
     // 设置组件类型
     // 设置组件类型
@@ -366,6 +392,7 @@ const option = {
   },
   },
   statistic: {
   statistic: {
     title: {
     title: {
+      offsetY:0,//垂直方向的偏移量
       style: {
       style: {
         whiteSpace: 'pre-wrap',
         whiteSpace: 'pre-wrap',
         lineHeight: 2,
         lineHeight: 2,
@@ -377,6 +404,7 @@ const option = {
       content: '总计'
       content: '总计'
     },
     },
     content: {
     content: {
+      offsetY:0,//垂直方向的偏移量
       style: {
       style: {
         whiteSpace: 'pre-wrap',
         whiteSpace: 'pre-wrap',
         lineHeight: 2,
         lineHeight: 2,