diff --git a/src/packages/components/Charts/Bars/BarCrossrange/config.ts b/src/packages/components/Charts/Bars/BarCrossrange/config.ts new file mode 100644 index 00000000..f1333095 --- /dev/null +++ b/src/packages/components/Charts/Bars/BarCrossrange/config.ts @@ -0,0 +1,43 @@ +import { getUUID } from '@/utils' +import { BarCrossrangefig } from './index' +import { ConfigType, CreateComponentType } from '@/packages/index.d' +import omit from 'lodash/omit' + +export default class Config implements CreateComponentType { + public id: string = getUUID() + public key: string = BarCrossrangefig.key + + public chartData: Exclude = omit(BarCrossrangefig, ['node']) + + public attr = { x: 0, y: 0, w: 500, h: 300 } + + // 图表配置项 + public config = { + 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' + } + ] + } + + // 设置坐标 + public setPosition(x: number, y: number): void { + this.attr.x = x + this.attr.y = y + } +} diff --git a/src/packages/components/Charts/Bars/BarCrossrange/config.vue b/src/packages/components/Charts/Bars/BarCrossrange/config.vue new file mode 100644 index 00000000..3e3b929c --- /dev/null +++ b/src/packages/components/Charts/Bars/BarCrossrange/config.vue @@ -0,0 +1,7 @@ + + + diff --git a/src/packages/components/Charts/Bars/BarCrossrange/index.vue b/src/packages/components/Charts/Bars/BarCrossrange/index.vue index f3abbb36..e3773fb9 100644 --- a/src/packages/components/Charts/Bars/BarCrossrange/index.vue +++ b/src/packages/components/Charts/Bars/BarCrossrange/index.vue @@ -1,13 +1,41 @@ - \ No newline at end of file +