A echats pie chart refresh code

Source: Internet
Author: User

Pie chart Style


Code

function Currentcount (data) {var leveloption = {title:{Show:true,
               		Text: "Alarm level", x: "Center", y:130}, tooltip:{ Formatter: "{a} <br/>{b} level: {C} (% of {d}%)", Show:true, Trigger: "Item "}, Color: [" #C0C0C0 ",], legend:{dat
               		A:[], x: "Center", y: "Bottom"}, series:[{ Data:[{name: "", Value: ""}], type: "Pie", Name: "Statistics by alarm level", radius:["40%"
               		, "55%"]}],} var typeoption = {title:{
               	Show:true, Text: "Alarm category", X: "Center", y:130}, ToolTip{formatter: "{A} <br/>{b} Category: {C} (% of {d}%)", Show:true, Trigge
               		R: "Item"}, Color: ["#C0C0C0",], legend:{
               		Data:[], x: "Center", y: "Bottom"}, series:[{ Data:[{name: "", Value: ""}], type: "Pie", Name: "Statistics by alarm category", radius : ["40%", "55%"]}],}//Current alarm Statistics pie chart $ajax (Countjsonurl, "post", Data,functi
             	  On (option) {mychartalevelpie.clear ();
                  Mychartatypepie.clear ();
               			if (option.success) {function Data (name,value) {this.name = name;
               		This.value = value;
            } if (Option.obj.levelDatas) {var leveldatas = Option.obj.levelDatas;      		var levelseriesdataseharts = new Array ();
                  		var levellegenddataseharts = new Array ();
                  			for (var i=leveldatas.length; i>0; i--) {var leveldata = Leveldatas.shift ();
                  			var data = new data (leveldata.alarmlevel,leveldata.quantum);
                  			Levelseriesdataseharts.push (data);
                  		Levellegenddataseharts.push (Leveldata.alarmlevel);
                  		} leveloption.series[0].data = Levelseriesdataseharts;
                  	LevelOption.legend.data = Levellegenddataseharts; } if (Option.obj.typeDatas) {var typedatas = Option.obj.typeData
                  		S
                  		var typeseriesdataseharts = new Array ();
                  		var typelegenddataseharts = new Array ();
          for (var i=typedatas.length; i>0; i--) {var typedata = Typedatas.shift ();        			var data = new data (typedata.alarmtype,typedata.quantum);
                  			Typeseriesdataseharts.push (data);
                  		Typelegenddataseharts.push (Typedata.alarmtype);
                  		} typeoption.series[0].data = Typeseriesdataseharts;
                  	TypeOption.legend.data = Typelegenddataseharts;
                  	} mychartalevelpie.hideloading ();
                  	Mychartatypepie.hideloading ();
					Mychartatypepie.setoption (typeoption);
					
					Mychartalevelpie.setoption (leveloption);
					var typeinfo = document.getElementById (' Alarmtypeinfo ');
	                	if (option.obj.typeInfo) {var typeinfos = Option.obj.typeInfo;
	                	var temp = ""; for (var i=typeinfos.length; i>0; i--) {temp + = "<span>" + typeinfos.shift () + "</span><
	       Br> "} console.info (temp);         	typeinfo.innerhtml = temp;
	                } var levelinfo = document.getElementById (' Alarmalevelinfo ');
	                	if (option.obj.levelInfo) {var levelinfos = Option.obj.levelInfo;
	                	var temp = ""; for (var i=levelinfos.length; i>0; i--) {temp + = "<span>" + levelinfos.shift () + "&LT;/SPAN&GT;&L
	                T;br> "} levelinfo.innerhtml = temp;
                  	}}else{mychartatypepie.setoption (typeoption);
                  	Mychartalevelpie.setoption (leveloption);
                  	Mychartatypepie.showloading ({text: ' No data ', Color: ' #c23531 ', zlevel:0});
                  Mychartalevelpie.showloading ({text: ' No data ', Color: ' #c23531 ', zlevel:0});
        }
             }); }


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.