var ChecekerCurECharts_View_ID = -1;
var CheckerCurEcharts = null;
var CheckerCurOption = {
  animation: false,
  grid: {
    top: 40,
    left: 50,
    right: 40,
    bottom: 50
  },
  xAxis: {
    name: '轮次',
    minorTick: {
      show: true
    },
    minorSplitLine: {
      show: true
    }
  },
  yAxis: {
    name: '电流0.1uA',
    minorTick: {
      show: true
    },
    minorSplitLine: {
      show: true
    }
  },
  dataZoom: [
    {
      show: true,
      type: 'inside',
      filterMode: 'none',
      xAxisIndex: [0],

    },{
      show: true,
      type: 'slider',
      filterMode: 'none',
      xAxisIndex: [0],
    	
    },
    {
      show: true,
      type: 'inside',
      filterMode: 'none',
      yAxisIndex: [0],
  
    },{
      show: true,
      type: 'slider',
      filterMode: 'none',
      yAxisIndex: [0],
  
    }
  ],
    tooltip: {
      trigger: 'axis'
    },
  series: [
    {
      type: 'line',
      showSymbol: false,
      clip: true,
	  smooth: true,
      data: [],
    }
  ],
  
};
var CheckerCurData = [];
function CheckerShowCurEcharts(cur)
{
		
	if(ChecekerCurECharts_View_ID < 0)
	{
		CheckerCurData = [[1,cur]];
		CheckerCurOption.series.data = CheckerCurData;
		//CheckerCurEcharts.setOption(CheckerCurOption);
		ChecekerCurECharts_View_ID = layer.open({
		title:'电流趋势',
	    type: 1,
	    shade: false, // 不显示遮罩
	    content: $('#checker_Curgraph_Mes'), // 捕获的元素
		area: 'auto',
	    end: function(){
	     ChecekerCurECharts_View_ID = -1
	    },
		success:function(){
		
			if(CheckerCurEcharts == null)
			{
				var CheckerCurEcharts_dom = document.getElementById('checker_cur_echarts');
				 CheckerCurEcharts =  echarts.init(CheckerCurEcharts_dom, "walden");
			}else{
				CheckerCurEcharts.clear();
			}
			 
			  CheckerCurOption.series.data = CheckerCurData;
			  CheckerCurEcharts.setOption(CheckerCurOption);
			  CheckerCurEcharts.resize();
		},
		resizing:function(){
			if(CheckerCurEcharts != null)
			{
				CheckerCurEcharts.resize();
			}
			
		},
	  });
	}else{
		
		var item = [CheckerCurData.length+1,cur];
		CheckerCurData.push(item);
		 CheckerCurEcharts.setOption({
		    series: [
		      {
		        data: CheckerCurData,
		      }
		    ]
		  });
		
		
	}
}

