diff --git a/src/views/components/emoEnergyConverter.vue b/src/views/components/emoEnergyConverter.vue index da7b9e6..ffa8700 100644 --- a/src/views/components/emoEnergyConverter.vue +++ b/src/views/components/emoEnergyConverter.vue @@ -311,8 +311,8 @@ function initQXNLZHEcharts(kline, qxnlzhqData) { type: 'bar', stack: 'total', data: middleRangeData1, - barWidth: '10%', - barCategoryGap: '45%', + barWidth: '20%', + barCategoryGap: '40%', itemStyle: { normal: { color: 'rgba(0,0,0,0)' // 默认透明 @@ -326,8 +326,8 @@ function initQXNLZHEcharts(kline, qxnlzhqData) { type: 'bar', stack: 'total', data: middleRangeData, - barWidth: '10%', - barCategoryGap: '45%', + barWidth: '20%', + barCategoryGap: '40%', itemStyle: { normal: { color: 'rgba(0,0,0,0)' // 默认透明 @@ -424,6 +424,10 @@ function initQXNLZHEcharts(kline, qxnlzhqData) { }; // 应用配置 qxnlzhqEchartsInstance.setOption(option); + // 监听窗口大小变化,调整图表尺寸 + window.addEventListener('resize', () => { + qxnlzhqEchartsInstance.resize() + }) } onBeforeUnmount(() => { @@ -436,6 +440,6 @@ onBeforeUnmount(() => { \ No newline at end of file