amis2/examples/components/EChartsEditor/Series.tsx
吴多益 56e9602869
feat: table view 组件 (#2139)
* 更新 snapshot

* feat: datetime 组件时间支持可点选 (#2100)

* 文档和一些小修改 (#2107)

* jssdk 支持 hash路由改造

* 更新文档

* default value 和  value 逻辑优化

* 优化 value 的处理逻辑

* 同步值应该固定某一种模式

* name 干脆支持 filter 好了

* 更新的时候获取数据不一致

* 修复 qrcode 获取值方式

* columns 有可能不是数组

* feat: 增加 table-view 初步

* 修复 ECharts 编辑器的问题

* 方便编辑器编辑

Co-authored-by: 2betop <2betop.cn@gmail.com>
Co-authored-by: Allen <yupeng.cqupt@qq.com>
Co-authored-by: RickCole <rickcole21@outlook.com>
2021-06-24 10:18:12 +08:00

63 lines
1.5 KiB
TypeScript

/**
* @file 各种图表的配置
*/
import {buildOptions, select} from './Common';
//@ts-ignore
const lineOptions = __inline('./option-parts/option.series-line.json');
//@ts-ignore
const barOptions = __inline('./option-parts/option.series-bar.json');
//@ts-ignore
const pieOptions = __inline('./option-parts/option.series-pie.json');
//@ts-ignore
const gaugeOptions = __inline('./option-parts/option.series-gauge.json');
//@ts-ignore
const funnelOptions = __inline('./option-parts/option.series-funnel.json');
//@ts-ignore
const radarOptions = __inline('./option-parts/option.series-radar.json');
const buildSerieOptions = (type: string, options: any) => {
return {
type: 'container',
visibleOn: `this.type == "${type}"`,
body: buildOptions('', options)
};
};
export default {
type: 'combo',
name: 'series',
tabsMode: true,
tabsLabelTpl: '系列${index|plus}',
lazyLoad: true,
label: '',
multiLine: true,
multiple: true,
addButtonText: '新增系列',
items: [
select('type', '图表类型', [
'line',
'bar',
'pie',
'radar',
'funnel',
'gauge'
]),
{
type: 'input-array',
name: 'data', //TODO: 目前只支持一维
label: '数据',
items: {
type: 'input-number'
}
},
buildSerieOptions('line', lineOptions),
buildSerieOptions('bar', barOptions),
buildSerieOptions('pie', pieOptions),
buildSerieOptions('funnel', funnelOptions),
buildSerieOptions('gauge', gaugeOptions),
buildSerieOptions('radar', radarOptions)
]
};