feat: 视图增加组合图;折线面积优化

This commit is contained in:
junjie 2021-09-01 10:12:24 +08:00
parent 58a607eddd
commit 7a3efa6804
4 changed files with 73 additions and 6 deletions

View File

@ -736,3 +736,60 @@ export const BASE_TREEMAP = {
}
]
}
export const BASE_MIX = {
title: {
text: '',
textStyle: {
fontWeight: 'normal'
}
},
grid: {
containLabel: true
},
tooltip: {},
legend: {
show: true,
type: 'scroll',
itemWidth: 10,
itemHeight: 10,
icon: 'rect',
data: []
},
xAxis: {
data: []
},
yAxis: {
type: 'value'
},
series: [],
dataZoom: [
{
type: 'slider',
show: false,
xAxisIndex: [0],
start: 0,
end: 100
},
{
type: 'slider',
show: false,
yAxisIndex: [0],
left: '93%',
start: 0,
end: 100
},
{
type: 'inside',
xAxisIndex: [0],
start: 0,
end: 100
},
{
type: 'inside',
yAxisIndex: [0],
start: 0,
end: 100
}
]
}

View File

@ -36,8 +36,12 @@ export function baseLineOption(chart_option, chart) {
type: customAttr.size.lineType
}
y.smooth = customAttr.size.lineSmooth
y.areaStyle = {
opacity: customAttr.size.lineArea ? 0.6 : 0
if (customAttr.size.lineArea) {
y.areaStyle = {
opacity: 0.6
}
} else {
delete y.areaStyle
}
}
// label

View File

@ -49,8 +49,12 @@ export function baseMixOption(chart_option, chart) {
type: customAttr.size.lineType
}
y.smooth = customAttr.size.lineSmooth
y.areaStyle = {
opacity: customAttr.size.lineArea ? 0.6 : 0
if (customAttr.size.lineArea) {
y.areaStyle = {
opacity: 0.6
}
} else {
delete y.areaStyle
}
}
// scatter

View File

@ -16,7 +16,8 @@ import {
BASE_GAUGE,
BASE_MAP,
BASE_SCATTER,
BASE_TREEMAP
BASE_TREEMAP,
BASE_MIX
} from '../chart/chart'
import { baseBarOption, stackBarOption, horizontalBarOption, horizontalStackBarOption } from '../chart/bar/bar'
import { baseLineOption, stackLineOption } from '../chart/line/line'
@ -152,8 +153,9 @@ export default {
} else if (chart.type === 'treemap') {
chart_option = baseTreemapOption(JSON.parse(JSON.stringify(BASE_TREEMAP)), chart)
} else if (chart.type === 'chart-mix') {
chart_option = baseMixOption(JSON.parse(JSON.stringify(BASE_BAR)), chart)
chart_option = baseMixOption(JSON.parse(JSON.stringify(BASE_MIX)), chart)
}
console.log(JSON.stringify(chart_option))
if (chart.type === 'map') {
const customAttr = JSON.parse(chart.customAttr)