mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
Merge pull request #197 from 948764321/bugfix/chart-optionState
fix: 图表切换后,选项状态显示错误
This commit is contained in:
commit
6c233d9fa0
@ -103,11 +103,15 @@ export default () => {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
let options: ChartOptions = {}
|
const options: ChartOptions = {
|
||||||
if (type === 'horizontalBar') options = { horizontalBars: true }
|
...(type === 'bar' ? { horizontalBars: false, stackBars: false } : {}),
|
||||||
else if (type === 'area') options = { showArea: true }
|
...(type === 'horizontalBar' ? { horizontalBars: true, stackBars: false } : {}),
|
||||||
else if (type === 'scatter') options = { showLine: false }
|
...(type === 'line' ? { showLine: true, lineSmooth: true, showArea: false } : {}),
|
||||||
else if (type === 'ring') options = { donut: true }
|
...(type === 'area' ? { showLine: true, lineSmooth: true, showArea: true } : {}),
|
||||||
|
...(type === 'scatter' ? { showLine: false, lineSmooth: true, showArea: false } : {}),
|
||||||
|
...(type === 'pie' ? { donut: false } : {}),
|
||||||
|
...(type === 'ring' ? { donut: true } : {}),
|
||||||
|
}
|
||||||
|
|
||||||
createElement({
|
createElement({
|
||||||
...newElement,
|
...newElement,
|
||||||
|
@ -230,12 +230,12 @@ watch(handleElement, () => {
|
|||||||
stackBars: _stackBars,
|
stackBars: _stackBars,
|
||||||
} = handleElement.value.options
|
} = handleElement.value.options
|
||||||
|
|
||||||
if (_lineSmooth !== undefined) lineSmooth.value = _lineSmooth as boolean
|
lineSmooth.value = !!_lineSmooth
|
||||||
if (_showLine !== undefined) showLine.value = _showLine
|
showLine.value = !!_showLine
|
||||||
if (_showArea !== undefined) showArea.value = _showArea
|
showArea.value = !!_showArea
|
||||||
if (_horizontalBars !== undefined) horizontalBars.value = _horizontalBars
|
horizontalBars.value = !!_horizontalBars
|
||||||
if (_donut !== undefined) donut.value = _donut
|
donut.value = !!_donut
|
||||||
if (_stackBars !== undefined) stackBars.value = _stackBars
|
stackBars.value = !!_stackBars
|
||||||
}
|
}
|
||||||
|
|
||||||
themeColor.value = handleElement.value.themeColor
|
themeColor.value = handleElement.value.themeColor
|
||||||
|
Loading…
x
Reference in New Issue
Block a user