diff --git a/docs/zh-CN/components/form/chart-radios.md b/docs/zh-CN/components/form/chart-radios.md new file mode 100644 index 000000000..5f05c71f0 --- /dev/null +++ b/docs/zh-CN/components/form/chart-radios.md @@ -0,0 +1,57 @@ +--- +title: Chart 单选框 +description: +type: 0 +group: ⚙ 组件 +menuName: Chart 单选框 +icon: +order: 34 +--- + +图表点选功能,用来做多个图表联动。 + +```schema: scope="body" +{ + "type": "form", + "debug": true, + "body": [ + { + "type": "chart-radios", + name: 'main', + chartValueField: 'num', + "options": [ + { + "label": "A", + "num": 100, + value: 'a' + }, + { + "label": "B", + "num": 120, + value: 'b' + }, + { + "label": "C", + "num": 30, + value: 'c' + }, + { + "label": "D", + "num": 40, + value: 'd' + } + ] + } + ] +} +``` + +## 属性表 + +除了支持 [普通表单项属性表](./formitem#%E5%B1%9E%E6%80%A7%E8%A1%A8) 中的配置以外,还支持下面一些配置 + +| 属性名 | 类型 | 默认值 | 说明 ## 二级标题 | +| ---------------------- | --------- | --------- | -------------------------- | +| config | `object` | | echart 图表配置 | +| showTooltipOnHighlight | `boolean` | `false` | 高亮的时候是否显示 tooltip | +| chartValueField | `string` | `"value"` | 图表数值字段名 | diff --git a/examples/components/Components.tsx b/examples/components/Components.tsx index 81ad49f74..c70283a5b 100644 --- a/examples/components/Components.tsx +++ b/examples/components/Components.tsx @@ -534,6 +534,16 @@ export const components = [ import('../../docs/zh-CN/components/form/radios.md').then(wrapDoc) ) }, + + { + label: 'Chart 单选框', + path: '/zh-CN/components/form/chart-radios', + component: React.lazy(() => + import('../../docs/zh-CN/components/form/chart-radios.md').then( + wrapDoc + ) + ) + }, { label: 'InputRating 评分', path: '/zh-CN/components/form/input-rating', diff --git a/examples/components/Play.jsx b/examples/components/Play.jsx index a27902de7..929c8f68e 100644 --- a/examples/components/Play.jsx +++ b/examples/components/Play.jsx @@ -35,7 +35,7 @@ const scopes = { "autoFocus": false, "api": "/api/mock/saveForm?waitSeconds=1", "mode": "horizontal", - "controls": SCHEMA_PLACEHOLDER, + "body": SCHEMA_PLACEHOLDER, "submitText": null, "actions": [] } @@ -62,7 +62,7 @@ const scopes = { "type": "form", "mode": "horizontal", "autoFocus": false, - "controls": [ + "body": [ SCHEMA_PLACEHOLDER ], "submitText": null,