1, echarts with the element ui drawer plugin error occurs, the last solution is to use element ui drawer open event, so reload in the open event, the needs of our project is to click on a data transfer to other data contained in this value, let it show; then and back to complete the data will be found in error, then the solution is in the data assignment ended, so he reloaded echarts
// and background data butt Method,: { echartsData (Row) { the this . $ NextTick (() => { the this . HTTP $ .get ( ` /bus/asset-flaw/chart/${row.assetId}?listType= {$ the this .listType} `) .then (RES => { the this .tabData2 = res.data.content.assetStatistics // data line graph of the this .lineData (Row) // reloaded echarts the this .line () // adaptive window the this .inits () }) . the catch (error => { the console.log (Error.message) }) }) }, Line () { the this . $ echarts.init ( the this . $ refs.main) .setOption ( the this .option3) }, INITs () { the let Self = the this / / because this function will change the arrow pointing, pointing to windows. Therefore, this first stored window.onresize = function () { Self. $ Echarts.init (Self. $ Refs.main) .resize () } }, // a line graph assignment Linedata (Row) { this .option3.title = .text the this .textContent + 'trends' + '-' + row.startUrl the let Asset =this.tabData2.map(x => x.needAttentionCount) let findNewCount = this.tabData2.map(x => x.findNewCount) let findRecurringCount = this.tabData2.map(x => x.findRecurringCount) let findOpenCount = this.tabData2.map(x => x.findOpenCount) this.option3.series[0].data = asset this.option3.series[0].name = 'A' this.option3.series[1].data = findNewCount this.option3.series[1].name = 'B' this.option3.series[2].data = findRecurringCount this.option3.series[2].name = 'C' this.option3.series[3].data = findOpenCount this.option3.series[3].name = 'D' let historyTime = this.tabData2.map(x => x.historyTime) // 时间 this.option3.xAxis.data = historyTime this.option3.legend.data = ['A','B','C','D'] }, }
2, so that a percentage of the pie chart is not displayed as 0
0 // hide percentage of lineHide (opt) { opt.data.forEach (Item => { IF (item.value === 0) { item.value = null } }) },