-
+
+
);
};
diff --git a/packages/plugins/@nocobase/plugin-data-visualization/src/client/chart/g2plot/configs.ts b/packages/plugins/@nocobase/plugin-data-visualization/src/client/chart/g2plot/configs.ts
index a43af373e9..edbbce55e7 100644
--- a/packages/plugins/@nocobase/plugin-data-visualization/src/client/chart/g2plot/configs.ts
+++ b/packages/plugins/@nocobase/plugin-data-visualization/src/client/chart/g2plot/configs.ts
@@ -9,10 +9,95 @@
import config, { FieldConfigProps } from '../configs';
const { booleanField } = config;
+import { lang } from '../../locale';
export default {
isStack: (props: FieldConfigProps) => booleanField({ name: 'isStack', title: 'isStack', ...props }),
smooth: (props: FieldConfigProps) => booleanField({ name: 'smooth', title: 'smooth', ...props }),
isPercent: (props: FieldConfigProps) => booleanField({ name: 'isPercent', title: 'isPercent', ...props }),
isGroup: (props: FieldConfigProps) => booleanField({ name: 'isGroup', title: 'isGroup', ...props }),
+ size: () => ({
+ size: {
+ title: lang('Size'),
+ type: 'object',
+ 'x-decorator': 'FormItem',
+ 'x-component': 'Space',
+ properties: {
+ type: {
+ 'x-component': 'Select',
+ 'x-component-props': {
+ allowClear: false,
+ },
+ default: 'ratio',
+ enum: [
+ {
+ label: lang('Aspect ratio'),
+ value: 'ratio',
+ },
+ {
+ label: lang('Fixed height'),
+ value: 'fixed',
+ },
+ ],
+ },
+ fixed: {
+ type: 'number',
+ 'x-component': 'InputNumber',
+ 'x-component-props': {
+ min: 0,
+ addonAfter: 'px',
+ },
+ 'x-reactions': [
+ {
+ dependencies: ['.type'],
+ fulfill: {
+ state: {
+ visible: "{{$deps[0] === 'fixed'}}",
+ },
+ },
+ },
+ ],
+ },
+ ratio: {
+ type: 'object',
+ 'x-component': 'Space',
+ 'x-reactions': [
+ {
+ dependencies: ['.type'],
+ fulfill: {
+ state: {
+ visible: "{{$deps[0] === 'ratio'}}",
+ },
+ },
+ },
+ ],
+ properties: {
+ width: {
+ type: 'number',
+ 'x-component': 'InputNumber',
+ 'x-component-props': {
+ placeholder: lang('Width'),
+ min: 1,
+ },
+ },
+ colon: {
+ type: 'void',
+ 'x-component': 'Text',
+ 'x-component-props': {
+ children: ':',
+ },
+ },
+ height: {
+ type: 'number',
+ 'x-component': 'InputNumber',
+ 'x-component-props': {
+ placeholder: lang('Height'),
+ min: 1,
+ },
+ },
+ },
+ },
+ },
+ },
+ }),
};
diff --git a/packages/plugins/@nocobase/plugin-data-visualization/src/client/chart/g2plot/g2plot.ts b/packages/plugins/@nocobase/plugin-data-visualization/src/client/chart/g2plot/g2plot.ts
index 1589b36b88..605e3349a4 100644
--- a/packages/plugins/@nocobase/plugin-data-visualization/src/client/chart/g2plot/g2plot.ts
+++ b/packages/plugins/@nocobase/plugin-data-visualization/src/client/chart/g2plot/g2plot.ts
@@ -17,7 +17,7 @@ export class G2PlotChart extends Chart {
name,
title,
Component: getAntChart(Component),
- config: ['xField', 'yField', 'seriesField', ...(config || [])],
+ config: ['xField', 'yField', 'seriesField', 'size', ...(config || [])],
});
this.addConfigs(configs);
}
diff --git a/packages/plugins/@nocobase/plugin-data-visualization/src/client/renderer/ChartRendererProvider.tsx b/packages/plugins/@nocobase/plugin-data-visualization/src/client/renderer/ChartRendererProvider.tsx
index 8e6779859d..1aa8bf9963 100644
--- a/packages/plugins/@nocobase/plugin-data-visualization/src/client/renderer/ChartRendererProvider.tsx
+++ b/packages/plugins/@nocobase/plugin-data-visualization/src/client/renderer/ChartRendererProvider.tsx
@@ -147,11 +147,9 @@ export const ChartRendererProvider: React.FC
= (props) => {
return (
-
-
- {props.children}
-
-
+
+ {props.children}
+
);
diff --git a/packages/plugins/@nocobase/plugin-data-visualization/src/locale/en-US.json b/packages/plugins/@nocobase/plugin-data-visualization/src/locale/en-US.json
index a67ba9c8fc..88902e283b 100644
--- a/packages/plugins/@nocobase/plugin-data-visualization/src/locale/en-US.json
+++ b/packages/plugins/@nocobase/plugin-data-visualization/src/locale/en-US.json
@@ -87,5 +87,12 @@
"Show border": "Show border",
"Transformation tip": "Fields allow multiple transformations, applied sequentially. Pay attention to data type changes after each transformation. Drag-and-drop functionality enables adjustment of transformation order.",
"Type conversion": "Type conversion",
- "Transformer": "Transformer"
+ "Transformer": "Transformer",
+ "Size": "Size",
+ "Width": "Width",
+ "Height": "Height",
+ "Aspect ratio": "Aspect ratio",
+ "Fixed height": "Fixed height",
+ "Show background": "Show background",
+ "Show padding": "Show padding"
}
diff --git a/packages/plugins/@nocobase/plugin-data-visualization/src/locale/zh-CN.json b/packages/plugins/@nocobase/plugin-data-visualization/src/locale/zh-CN.json
index 686fae82e7..c1c9d272a7 100644
--- a/packages/plugins/@nocobase/plugin-data-visualization/src/locale/zh-CN.json
+++ b/packages/plugins/@nocobase/plugin-data-visualization/src/locale/zh-CN.json
@@ -88,5 +88,12 @@
"Show border": "显示边框",
"Transformation tip": "一个字段可以应用多次转换,会按照顺序执行,请注意每次转换后的数据类型,拖动可以调整转换顺序。",
"Type conversion": "类型转换",
- "Transformer": "转换方法"
+ "Transformer": "转换方法",
+ "Size": "尺寸",
+ "Width": "宽",
+ "Height": "高",
+ "Aspect ratio": "宽高比",
+ "Fixed height": "固定高度",
+ "Show background": "显示背景",
+ "Show padding": "显示内边距"
}
diff --git a/packages/plugins/@nocobase/plugin-mobile/src/client/mobile/Mobile.tsx b/packages/plugins/@nocobase/plugin-mobile/src/client/mobile/Mobile.tsx
index 87ca23e234..ffe39d81ad 100644
--- a/packages/plugins/@nocobase/plugin-mobile/src/client/mobile/Mobile.tsx
+++ b/packages/plugins/@nocobase/plugin-mobile/src/client/mobile/Mobile.tsx
@@ -53,7 +53,6 @@ export const Mobile = () => {
marginBlock: 18,
borderRadiusBlock: 0,
boxShadowBlock: 'none',
- borderBottomBlock: '1px solid var(--adm-color-border)',
},
}}
>