• echarts难点说明


    首先echarts
    
    系统封装echarts说明:
    </script>	<script type="text/javascript" src="/hengs/static/module/cimss-echar/resources/js/echars/js/echarts.js"></script>
    	<script>
    		var echar = {
    			imgData : "",
    			initEChart : function(){
    				require.config({
    			        paths: {
    			            echarts: '/hengs/static/module/cimss-echar/resources/js/echars/js'
    			        }
    			    });
    			},
    			
    			loadChart : function(option,cdom){
    				echar.initEChart();
    				var that = this;
    				require(
    			        [
    			            'echarts',
    			            'echarts/chart/bar',
    			            'echarts/chart/line',
    			            'echarts/chart/pie',
    			            'echarts/chart/gauge',
    			            'echarts/chart/map'
    			        ],
    			        function (ec) {
    			            var myChart = ec.init(cdom); 
    			            myChart.showLoading({
    			                text : "图表数据正在努力加载..."
    			            });
    			            
    			            myChart.hideLoading();
    	           	 		myChart.setOption(option);
    	            		echar.imgData = myChart.getDataURL('png');//获取base64编码
    			        }
    			    );
    			},
    			
    			getSeriesdata : function (name,etype,edata){
    				var series = new Array();
    				for(var i = 0;i < name.length;i++){
    					var item = {
    						name : name[i],
    						type : etype,
    						data : edata[i].split(",")
    					}
    					series.push(item);
    				}
    				return series;
    			},
    			
    			post : function (url,params){
    				var tempForm = document.createElement("form");
    				tempForm.action = url;
    				tempForm.method = "post";
    				tempForm.style.display = "none";
    				for(var x in params){
    					var opt = document.createElement("textarea");
    					opt.name = x;
    					opt.value = params[x];
    					tempForm.appendChild(opt);
    				}
    				document.body.appendChild(tempForm);
    				tempForm.submit();
    			}
    		}
    	</script>
    
  • 相关阅读:
    jenkins, docker-composer
    php pass-by-reference deprecated &$-->$
    showslow / YSlow for PhantomJS/slimerjs(gecko)/phantomas
    FW qunit introduction
    FW: AMD, CMD, CommonJS和UMD
    nodejs unit test related----faker-cli, sinonjs, mock/stub
    cs api测试
    CloudStack 4.3功能前瞻
    devcloud
    DevCloud for CloudStack Development
  • 原文地址:https://www.cnblogs.com/ComputerVip/p/12764971.html
Copyright © 2020-2023  润新知