mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
fix: 修改全局设置不触发的问题
This commit is contained in:
@@ -9,7 +9,7 @@ import { use } from 'echarts/core'
|
||||
import { CanvasRenderer } from 'echarts/renderers'
|
||||
import { BarChart } from 'echarts/charts'
|
||||
import config from './config'
|
||||
import merge from 'lodash/merge'
|
||||
import { mergeTheme } from '@/packages/public/chart'
|
||||
import {
|
||||
GridComponent,
|
||||
TooltipComponent,
|
||||
@@ -41,7 +41,9 @@ use([
|
||||
TitleComponent
|
||||
])
|
||||
|
||||
const includes = ['title', 'legend', 'xAxis', 'yAxis']
|
||||
|
||||
const option = computed(() => {
|
||||
return merge(props.chartData.option, props.themeSetting)
|
||||
return mergeTheme( props.chartData.option, props.themeSetting, includes)
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -10,7 +10,6 @@ export default class Config extends publicConfig implements CreateComponentType
|
||||
|
||||
// 图表配置项
|
||||
public option = echartOptionProfixHandle({
|
||||
backgroundColor: 'rgba(0,0,0,0)',
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
|
||||
@@ -42,7 +42,7 @@ use([
|
||||
])
|
||||
|
||||
const option = computed(() => {
|
||||
return merge(props.chartData.option, props.themeSetting)
|
||||
return merge(props.themeSetting, props.chartData.option)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { use, graphic } from 'echarts/core'
|
||||
import { CanvasRenderer } from 'echarts/renderers'
|
||||
import { LineChart } from 'echarts/charts'
|
||||
import config from './config'
|
||||
import merge from 'lodash/merge'
|
||||
import { mergeTheme } from '@/packages/public/chart'
|
||||
import {
|
||||
GridComponent,
|
||||
TooltipComponent,
|
||||
@@ -41,7 +41,9 @@ use([
|
||||
TitleComponent
|
||||
])
|
||||
|
||||
const includes = ['title', 'legend', 'xAxis', 'yAxis']
|
||||
|
||||
const option = computed(() => {
|
||||
return merge(props.chartData.option, props.themeSetting)
|
||||
return mergeTheme( props.chartData.option, props.themeSetting, includes)
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -15,7 +15,7 @@ export default class Config extends publicConfig implements CreateComponentType
|
||||
},
|
||||
legend: {
|
||||
top: '5%',
|
||||
left: 'center'
|
||||
left: 'center',
|
||||
},
|
||||
series: [
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ import VChart from 'vue-echarts'
|
||||
import { use, graphic } from 'echarts/core'
|
||||
import { CanvasRenderer } from 'echarts/renderers'
|
||||
import { PieChart } from 'echarts/charts'
|
||||
import merge from 'lodash/merge'
|
||||
import { mergeTheme } from '@/packages/public/chart'
|
||||
import config from './config'
|
||||
import {
|
||||
GridComponent,
|
||||
@@ -41,7 +41,9 @@ use([
|
||||
TitleComponent
|
||||
])
|
||||
|
||||
const includes = ['title', 'legend']
|
||||
|
||||
const option = computed(() => {
|
||||
return merge(props.chartData.option, props.themeSetting)
|
||||
return mergeTheme( props.chartData.option, props.themeSetting, includes)
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user