Use echarts, in vue to display charts according to different search criteria

The

code is as follows, where the iviewui used by the form of the page

<Input v-model="search" placeholder="Enter something..." style="width: 300px" />
<Button type="primary" @click="handleSearch()"></Button>


<div ref="chartBar" style="height:300px;"></div>


  mounted () {
    this.$nextTick(() => {
      this.getData()
    })
  },
  methods: {
    getData () {
      this.$get( //axios
        "data.json",//
        { keywords: this.search },//search""
        response => {
          this.barDataHandle(response.data)
        }
      )
    },
    barDataHandle (data) {
       //echarts
      this.chartBar("", this.$refs.chartBar, legendData, courses, seriesData)
    },
    chartBar (subtext, chartBar, legendData, xAxisData, seriesData) {
      // domecharts
      let bar = echarts.init(chartBar)
      // 
      bar.setOption({
        title: {
          text: "",
          subtext: subtext
        },
        legend: {
          top: 30,
          data: legendData
        },
        tooltip: {
          trigger: "axis",
          axisPointer: {
            type: "shadow" // :"line" | "shadow"
          }
        },
        grid: {
          left: "3%",
          right: "4%",
          bottom: "3%",
          containLabel: true
        },
        xAxis: [
          {
            type: "category",
            data: xAxisData,
            axisTick: {
              alignWithLabel: true
            }
          }
        ],
        yAxis: [
          {
            type: "value"
          }
        ],
        series: seriesData
      })
    },
    handleSearch () {
      //search
      this.getData()
    }
  }

when you enter the page, get the data returned by the backend API. The echarts chart is displayed normally, as shown in the figure above.

after clicking search, the API passes the parameters of the search conditions to retrieve the data, but the echarts diagram is not re-rendered. What should I do?

Sep.28,2021

  let el = echarts.init(document.getElementById("id"));
  el .clear();
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eaf5aa-4f71c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eaf5aa-4f71c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?