2020-11-02 19:39:21 +08:00
|
|
|
/**
|
|
|
|
* @file 各种图表的配置
|
|
|
|
*/
|
|
|
|
|
|
|
|
import {buildOptions, select} from './Common';
|
|
|
|
|
|
|
|
//@ts-ignore
|
|
|
|
const lineOptions = __inline('./option-parts/option.series-line.json');
|
|
|
|
|
|
|
|
const buildSerieOptions = (type: string, options: any) => {
|
|
|
|
return {
|
|
|
|
type: 'container',
|
2020-11-03 11:34:23 +08:00
|
|
|
visibleOn: `this.type == "${type}"`,
|
2020-11-02 19:39:21 +08:00
|
|
|
controls: buildOptions('', options)
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default {
|
|
|
|
type: 'tabs',
|
|
|
|
tabs: [
|
|
|
|
{
|
|
|
|
title: '系列',
|
|
|
|
controls: [
|
|
|
|
{
|
|
|
|
type: 'combo',
|
|
|
|
name: 'series',
|
|
|
|
label: '',
|
|
|
|
multiLine: true,
|
|
|
|
multiple: true,
|
|
|
|
addButtonText: '新增系列',
|
|
|
|
controls: [
|
|
|
|
select('type', '图表类型', ['line', 'bar']),
|
|
|
|
buildSerieOptions('line', lineOptions),
|
|
|
|
{
|
|
|
|
type: 'array',
|
|
|
|
name: 'data', //TODO: 目前只支持一维
|
|
|
|
label: '数据',
|
|
|
|
items: {
|
|
|
|
type: 'number'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|