diff --git a/frontend/src/views/chart/components/ChartComponent.vue b/frontend/src/views/chart/components/ChartComponent.vue index 6b5057a14f..46c9c1ec02 100644 --- a/frontend/src/views/chart/components/ChartComponent.vue +++ b/frontend/src/views/chart/components/ChartComponent.vue @@ -332,12 +332,14 @@ export default { }) return } - if (this.canvasStyleData.panel.themeColor === 'dark') { - chart_option.legend['pageIconColor'] = '#ffffff' - chart_option.legend['pageIconInactiveColor'] = '#8c8c8c' - } else { - chart_option.legend['pageIconColor'] = '#000000' - chart_option.legend['pageIconInactiveColor'] = '#8c8c8c' + if (chart_option.legend) { + if (this.canvasStyleData.panel.themeColor === 'dark') { + chart_option.legend['pageIconColor'] = '#ffffff' + chart_option.legend['pageIconInactiveColor'] = '#8c8c8c' + } else { + chart_option.legend['pageIconColor'] = '#000000' + chart_option.legend['pageIconInactiveColor'] = '#8c8c8c' + } } this.myEcharts(chart_option) this.$nextTick(() => (this.linkageActive()))