1. 程式人生 > >echarts縮放條設定

echarts縮放條設定

var start=0,end=100;
dataZoom: [{
                   show: true,
                   realtime: true,
                   start:start,
                   end:end
               	},{
                   type: 'inside',
                   realtime: true,
               	}],
			    grid: {
			        left: '1%',
			        right: '1%',
			        bottom: '6%',
			        containLabel: true
			    },
			    yAxis: {
			        type: 'value',
			        name:obj.y,
			    },
			    series: obj.series
			};
			echarts_.setOption(option,true);
			echarts_.on("dataZoom",function(param){
				console.log(param);
				if(param.end){//滑鼠拖動形式
					start=param.start;
					end=param.end;
				}else{//滑鼠滾輪形式
					start=param.batch[0].start;
					end=param.batch[0].end;
				}
			})