echarts tooltip prompt box plus unit

Effect:

 

1. A relatively simple method

series: [
        {
          name: "重大风险",
          type: "bar",
          data: data2,
          color: ExtremeRiskColor,
          tooltip: {
                    valueFormatter: function (value) {
                        return value + ' 个';
                    }
                },
        },
        {
          name: "较大风险",
          type: "bar",
          data: data3,
          color:LargerRiskColor,
          tooltip: {
                    valueFormatter: function (value) {
                        return value + ' 个';
                    }
                },
        },
        {
          name: "一般风险",
          type: "bar",
          data: data4,
          color: GeneralRiskColor,
          tooltip: {
                    valueFormatter: function (value) {
                        return value + ' 个';
                    }
                },
        },
]

Guess you like

Origin blog.csdn.net/qq_46617584/article/details/132291745