echarts 图表上数值显示

 lineCharts.setOption({
          tooltip: {
            trigger: "axis",
            formatter: function(data) {
              var res = [];
              data.forEach(element => {
                element.value = (element.value * 1.0).toFixed(2);
                res.push( element.marker + "" + element.seriesName + ":" + element.value +"," + element.name);
              });
              return res.join("
"
); } }, grid: { containLabel: true }, toolbox: { feature: { saveAsImage: {} } }, legend: { y: "bottom", x: "center", data: [1,2] }, xAxis: { type: "category", boundaryGap: false, data: ["A","B","C","D","E"] }, yAxis: { type: "value" }, series: [{'name':1,"type":"line","data":[1,2,3,4,5]},{'name':2,"type":"line", "data":[5,4,3,2,1]}] });

你可能感兴趣的:(web-development,echarts,javascript,ecmascript)