riku
2025-06-04 66e48ee8e286533a9614efa34d42297213c1da4b
src/components/chart/RealTimeLineChart.vue
@@ -44,6 +44,7 @@
      }
      if (this.lineChart) {
        this.lineChart.setOption(this.option, { notMerge: true });
        // console.log('折线图生成:立即');
      } else {
        this.onChartCreated = () => {
          this.lineChart.setOption(this.option, { notMerge: true });
@@ -53,9 +54,13 @@
  },
  mounted() {
    this.lineChart = echarts.init(this.$refs.lineChart);
    if (typeof this.onChartCreated === 'function') {
      this.onChartCreated();
    }
    this.onChartCreated();
    // setTimeout(() => {
    //   if (typeof this.onChartCreated === 'function') {
    //     this.onChartCreated();
    //     // console.log('折线图生成:滞后');
    //   }
    // }, 500);
  }
};
</script>
@@ -66,7 +71,7 @@
  justify-content: center;
}
.line-chart {
  width: 300px;
  width: 318px;
  height: 140px;
  /* border-bottom: 1px solid rgba(255, 255, 255, 0.329); */
}