mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
feat: 折线图支持堆叠模式
This commit is contained in:
parent
50f4f8f0e7
commit
dcd9429c81
@ -413,6 +413,7 @@ export default () => {
|
||||
break
|
||||
case 'lineChart':
|
||||
case 'line3DChart':
|
||||
if (el.grouping === 'stacked' || el.grouping === 'percentStacked') options.stack = true
|
||||
chartType = 'line'
|
||||
break
|
||||
case 'areaChart':
|
||||
|
@ -8,17 +8,17 @@
|
||||
|
||||
<template v-if="['bar', 'column', 'area', 'line'].includes(handleChartElement.chartType)">
|
||||
<div class="row">
|
||||
<Checkbox
|
||||
@update:value="value => updateOptions({ stack: value })"
|
||||
:value="stack"
|
||||
style="flex: 2;"
|
||||
>堆叠样式</Checkbox>
|
||||
<Checkbox
|
||||
v-if="handleChartElement.chartType === 'line'"
|
||||
@update:value="value => updateOptions({ lineSmooth: value })"
|
||||
:value="lineSmooth"
|
||||
style="flex: 3;"
|
||||
>使用平滑曲线</Checkbox>
|
||||
<Checkbox
|
||||
v-if="['bar', 'column', 'area'].includes(handleChartElement.chartType)"
|
||||
@update:value="value => updateOptions({ stack: value })"
|
||||
:value="stack"
|
||||
style="flex: 1;"
|
||||
>堆叠样式</Checkbox>
|
||||
</div>
|
||||
|
||||
<Divider />
|
||||
|
@ -121,15 +121,19 @@ export const getChartOption = ({
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
},
|
||||
series: data.series.map((item, index) => ({
|
||||
data: item,
|
||||
name: data.legends[index],
|
||||
type: 'line',
|
||||
smooth: lineSmooth,
|
||||
label: {
|
||||
show: true,
|
||||
},
|
||||
})),
|
||||
series: data.series.map((item, index) => {
|
||||
const seriesItem: echarts.SeriesOption = {
|
||||
data: item,
|
||||
name: data.legends[index],
|
||||
type: 'line',
|
||||
smooth: lineSmooth,
|
||||
label: {
|
||||
show: true,
|
||||
},
|
||||
}
|
||||
if (stack) seriesItem.stack = 'A'
|
||||
return seriesItem
|
||||
}),
|
||||
}
|
||||
}
|
||||
if(type === 'pie') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user