feat: 新增柱状图图表

This commit is contained in:
mtruning
2022-01-25 22:29:44 +08:00
parent 49fb0e1113
commit 62f012f2e9
4 changed files with 59 additions and 12 deletions
@@ -2,17 +2,36 @@ import { getUUID } from '@/utils'
import { BarCommonConfig } from './index'
export default class Config {
id: string = getUUID()
key: string = BarCommonConfig.key
attr = { x: 0, y: 0, w: 500, h: 300 }
private id: string = getUUID()
private key: string = BarCommonConfig.key
public attr = { x: 0, y: 0, w: 500, h: 300 }
// 图表配置项
public config = {
global: {}
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',
},
],
}
// 设置坐标
setPosition(x: number, y: number) {
public setPosition(x: number, y: number):void {
this.attr.x = x
this.attr.y = y
}