2022-02-06 01:04:05 +08:00
|
|
|
import { echartOptionProfixHandle, publicConfig } from '@/packages/utils'
|
2022-02-02 00:46:42 +08:00
|
|
|
import { BarCrossrangefig } from './index'
|
|
|
|
import { ConfigType, CreateComponentType } from '@/packages/index.d'
|
|
|
|
import omit from 'lodash/omit'
|
|
|
|
|
2022-02-06 01:04:05 +08:00
|
|
|
export default class Config extends publicConfig implements CreateComponentType {
|
2022-02-02 00:46:42 +08:00
|
|
|
public key: string = BarCrossrangefig.key
|
|
|
|
|
|
|
|
public chartData: Exclude<ConfigType, ['node']> = omit(BarCrossrangefig, ['node'])
|
|
|
|
|
|
|
|
// 图表配置项
|
2022-02-02 18:17:45 +08:00
|
|
|
public option = echartOptionProfixHandle({
|
2022-02-02 00:46:42 +08:00
|
|
|
backgroundColor: 'rgba(0,0,0,0)',
|
|
|
|
tooltip: {
|
|
|
|
trigger: 'axis',
|
|
|
|
axisPointer: {
|
|
|
|
type: 'shadow'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
xAxis: {
|
|
|
|
type: 'value',
|
|
|
|
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
|
|
|
|
},
|
|
|
|
yAxis: {
|
|
|
|
type: 'category'
|
|
|
|
},
|
|
|
|
series: [
|
|
|
|
{
|
|
|
|
data: [120, 200, 150, 80, 70, 110, 130],
|
|
|
|
type: 'bar'
|
|
|
|
}
|
|
|
|
]
|
2022-02-02 18:17:45 +08:00
|
|
|
})
|
2022-02-02 00:46:42 +08:00
|
|
|
|
|
|
|
// 设置坐标
|
|
|
|
public setPosition(x: number, y: number): void {
|
|
|
|
this.attr.x = x
|
|
|
|
this.attr.y = y
|
|
|
|
}
|
|
|
|
}
|