Add the following code in the ToolTip under option:
(This article is in the background to pass the value is also one of the viewstate[])
ToolTip: {show:true, Trigger: ' axis ',//show:true ,//default true showdelay:0,//display delay, add display delay to avoid frequent switching hidedelay:50,//hidden delay transitionduration:0,//Animation transform duration backgroundcolor: ' Rgba (0,0,0,0.7) ',//Background color (this is the default color) borderradius:8,//Border fillet padding:10,//[5, 10, 15, 20] inner margin Position:function (p) {//Position callback//Console.log &&A mp Console.log (P); return [p[0] + ten, p[1]-10]; }, Formatter:function (params, ticket, callback) {Console.log (params) var res = "Class" + ': ' + params[0].name + "class <br/>"; for (var i = 0, L = params.length; i < L; i++) { Res + = ' <br/> ' + params[i].seriesname + ': ' + params[i].value + ' <%=viewstate[' unit "]%>";//the string contents of the mouse hover display} setTimeout (function () { Only to simulate asynchronous callback callback (ticket, RES); }, (+) return ' loading ... '; }//formatter: "Template Formatter: <br/>{b}<br/>{a}:{c}<br/>{a1}:{c1}" },
:
Hope to help small friends! 0.0
PS: To display a random color for each graph of a column chart:
ItemStyle: {normal: {color:function (value) {return \ "#\" + (\ "00000\" + ((Math.random () *16777215+0.5) >>0). ToString (+)). Slice (-6); }},},
Add the above code within the series.
Set Echarts mouse hover style