39 lines
783 B
TypeScript
Raw Normal View History

2022-01-24 21:12:18 +08:00
import { getUUID } from '@/utils'
2022-01-25 18:19:44 +08:00
import { BarCommonConfig } from './index'
2022-01-24 21:12:18 +08:00
2022-01-25 11:09:32 +08:00
export default class Config {
2022-01-25 22:29:44 +08:00
private id: string = getUUID()
private key: string = BarCommonConfig.key
public attr = { x: 0, y: 0, w: 500, h: 300 }
2022-01-25 18:19:44 +08:00
// 图表配置项
2022-01-24 21:12:18 +08:00
public config = {
2022-01-25 22:29:44 +08:00
backgroundColor: 'rgba(0,0,0,0)',
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
},
yAxis: {
type: 'value',
},
series: [
{
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar',
},
],
2022-01-24 21:12:18 +08:00
}
2022-01-25 18:19:44 +08:00
// 设置坐标
2022-01-25 22:29:44 +08:00
public setPosition(x: number, y: number):void {
2022-01-25 18:19:44 +08:00
this.attr.x = x
this.attr.y = y
}
2022-01-24 21:12:18 +08:00
}