diff --git a/src/assets/images/chart/charts/bar_line.png b/src/assets/images/chart/charts/bar_line.png new file mode 100644 index 00000000..441fff93 Binary files /dev/null and b/src/assets/images/chart/charts/bar_line.png differ diff --git a/src/packages/components/Charts/Bars/BarLine/config.ts b/src/packages/components/Charts/Bars/BarLine/config.ts new file mode 100644 index 00000000..4c6c1805 --- /dev/null +++ b/src/packages/components/Charts/Bars/BarLine/config.ts @@ -0,0 +1,75 @@ +import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public' +import { BarLineConfig } from './index' +import { CreateComponentType } from '@/packages/index.d' +import cloneDeep from 'lodash/cloneDeep' +import dataJson from './data.json' + +export const includes = ['legend', 'xAxis', 'yAxis', 'grid'] +// 柱状折线组合图 分别定义series +// 写死name可以定义legend显示的名称 +export const barSeriesItem = { + type: 'bar', + barWidth: 15, + label: { + show: true, + position: 'top', + color: '#fff', + fontSize: 12 + }, + itemStyle: { + color: null, + borderRadius: 2 + } +} + +export const lineSeriesItem = { + type: 'line', + symbol: 'circle', + label: { + show: true, + position: 'top', + color: '#fff', + fontSize: 12 + }, + symbolSize: 5, //设定实心点的大小 + itemStyle: { + color: '#FFE47A', + borderWidth: 1 + }, + lineStyle: { + type: 'solid', + width: 3, + color: null + } +} + +export const option = { + tooltip: { + show: true, + trigger: 'axis', + axisPointer: { + show: true, + type: 'shadow' + } + }, + legend: { + data: null + }, + xAxis: { + show: true, + type: 'category' + }, + yAxis: { + show: true, + type: 'value' + }, + dataset: { ...dataJson }, + series: [barSeriesItem, lineSeriesItem] +} + +export default class Config extends PublicConfigClass implements CreateComponentType { + public key = BarLineConfig.key + public chartConfig = cloneDeep(BarLineConfig) + // 图表配置项 + public option = echartOptionProfixHandle(option, includes) +} diff --git a/src/packages/components/Charts/COMBINATIONS/BarLine/config.vue b/src/packages/components/Charts/Bars/BarLine/config.vue similarity index 71% rename from src/packages/components/Charts/COMBINATIONS/BarLine/config.vue rename to src/packages/components/Charts/Bars/BarLine/config.vue index b2f7c476..6a76ebdb 100644 --- a/src/packages/components/Charts/COMBINATIONS/BarLine/config.vue +++ b/src/packages/components/Charts/Bars/BarLine/config.vue @@ -1,43 +1,48 @@ \ No newline at end of file + diff --git a/src/packages/components/Charts/Bars/index.ts b/src/packages/components/Charts/Bars/index.ts index a101acbd..4ab9a776 100644 --- a/src/packages/components/Charts/Bars/index.ts +++ b/src/packages/components/Charts/Bars/index.ts @@ -1,5 +1,6 @@ -import { BarCommonConfig } from './BarCommon/index' -import { BarCrossrangeConfig } from './BarCrossrange/index' -import { CapsuleChartConfig } from './CapsuleChart/index' - -export default [BarCommonConfig, BarCrossrangeConfig, CapsuleChartConfig] +import { BarCommonConfig } from './BarCommon/index' +import { BarCrossrangeConfig } from './BarCrossrange/index' +import { CapsuleChartConfig } from './CapsuleChart/index' +import { BarLineConfig } from './BarLine/index' + +export default [BarCommonConfig, BarCrossrangeConfig, BarLineConfig, CapsuleChartConfig] diff --git a/src/packages/components/Charts/COMBINATIONS/BarLine/config.ts b/src/packages/components/Charts/COMBINATIONS/BarLine/config.ts deleted file mode 100644 index b62c4bab..00000000 --- a/src/packages/components/Charts/COMBINATIONS/BarLine/config.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public' -import { BarLineConfig } from './index' -import { CreateComponentType } from '@/packages/index.d' -import cloneDeep from 'lodash/cloneDeep' -import dataJson from './data.json' - - -export const includes = ['legend', 'xAxis', 'yAxis', 'grid'] -// 柱状折线组合图 分别定义series -// 写死name可以定义legend显示的名称 -export const barSeriesItem = { - type: 'bar', - barWidth: 15, - label: { - show: true, - position: 'top', - color: '#fff', - fontSize: 12 - }, - itemStyle: { - color: null, - borderRadius: 2 - } -} - -export const lineSeriesItem = { - type: 'line', - symbol: "circle", - label: { - show: true, - position: 'top', - color: '#fff', - fontSize: 12 - }, - symbolSize: 5, //设定实心点的大小 - itemStyle: { - color: '#FFE47A', - borderWidth: 1 - }, - lineStyle: { - type: 'solid', - width: 3, - color: null - } -} - -export const option = { - tooltip: { - show: true, - trigger: 'axis', - axisPointer: { - show: true, - type: 'shadow' - } - }, - legend: { - data:null - }, - xAxis: { - show: true, - type: 'category' - }, - yAxis: { - show: true, - type: 'value' - }, - dataset: { ...dataJson }, - series: [barSeriesItem, lineSeriesItem] -} - -export default class Config extends PublicConfigClass implements CreateComponentType { - public key = BarLineConfig.key - public chartConfig = cloneDeep(BarLineConfig) - // 图表配置项 - public option = echartOptionProfixHandle(option, includes) -} \ No newline at end of file diff --git a/src/packages/components/Charts/COMBINATIONS/BarLine/index.ts b/src/packages/components/Charts/COMBINATIONS/BarLine/index.ts deleted file mode 100644 index 1c236ed2..00000000 --- a/src/packages/components/Charts/COMBINATIONS/BarLine/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -// 公共类型声明 -import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' -// 当前[信息模块]分类声明 -import { ChatCategoryEnum,ChatCategoryEnumName } from '../../index.d' - -export const BarLineConfig: ConfigType = { - key: 'BarLine', - chartKey: 'VBarLine', - conKey: 'VCBarLine', - title: '柱状加折线图', - category: ChatCategoryEnum.COMBINATIONS, - categoryName: ChatCategoryEnumName.COMBINATION, - package: PackagesCategoryEnum.CHARTS, - chartFrame: ChartFrameEnum.ECHARTS, - image: 'bar_x.png' -} \ No newline at end of file diff --git a/src/packages/components/Charts/COMBINATIONS/index.ts b/src/packages/components/Charts/COMBINATIONS/index.ts deleted file mode 100644 index 3a131a97..00000000 --- a/src/packages/components/Charts/COMBINATIONS/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { BarLineConfig } from './BarLine/index' - -export default [BarLineConfig] \ No newline at end of file diff --git a/src/packages/components/Charts/index.d.ts b/src/packages/components/Charts/index.d.ts index 2f88e1df..d7cc2714 100644 --- a/src/packages/components/Charts/index.d.ts +++ b/src/packages/components/Charts/index.d.ts @@ -5,7 +5,6 @@ export enum ChatCategoryEnum { LINE = 'Lines', SCATTER = 'Scatters', MAP = 'Maps', - COMBINATIONS = 'COMBINATIONS', MORE = 'Mores' } diff --git a/src/packages/components/Charts/index.ts b/src/packages/components/Charts/index.ts index 63e5d657..20ffcc66 100644 --- a/src/packages/components/Charts/index.ts +++ b/src/packages/components/Charts/index.ts @@ -3,7 +3,6 @@ import Pies from './Pies' import Lines from './Lines' import Scatters from './Scatters' import Mores from './Mores' -import COMBINATIONS from "./COMBINATIONS"; import Maps from './Maps' -export const ChartList = [...Bars, ...Lines, ...Pies, ...Scatters, ...Maps,...COMBINATIONS, ...Mores] +export const ChartList = [...Bars, ...Lines, ...Pies, ...Scatters, ...Maps, ...Mores]