finereport11移动端js

1.移动端隐藏底部漏斗(可用不可见)

setTimeout(function(){
	if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)){
	//if(/android/i.test(navigator.userAgent)){
		document.getElementsByClassName("css-mbp0r")[0].children[0].children[0].children[0].children[0].children[0].children[1].style.zIndex=-1;
	}else{
		document.getElementsByClassName("css-ldbjc4n")[0].children[0].children[0].children[0].children[0].children[0].children[1].style.zIndex=-1;
		document.getElementsByClassName("css-ldbjc4n")[0].children[0].children[0].children[0].children[0].children[0].children[1].style.visibility='hidden';
	}
},20)
//注:移动端拖入绝对画布块则上述代码不生效,如需组件并排请用横向布局组件

2.标题行下滑粘于顶部

setTimeout(function(){
	document.getElementById("KEY_CAPTAIN").style.zIndex='10000';
	document.getElementById("KEY_CAPTAIN").style.position='sticky';
	document.getElementById("KEY_CAPTAIN").style.top='-1px';	

},300)

3.触发底部漏斗筛选框按钮

setTimeout(function(){
document.querySelector("[data-testid='FR_AUTO_TEST_FINE_FILTER']").click();
document.querySelector("[data-testid='FR_AUTO_TEST_FINE_FILTER']").click();
},500)

4.移动端全屏(IOS不支持)

setTimeout(function(){
	if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)){
		alert("IOS系统暂不支持全屏")
	}else if(document.fullscreenElement){
		document.exitFullscreen()
	}else{
		document.documentElement.requestFullscreen()
	}
},500)

5.js千分位

  • 图表-标签-自定义
function(){function toThousands(num){
var sign = num.toString().replace(/\d+.*/g,'');
var numint = parseInt(Math.abs(num));
var numfloor = Math.abs(num).toString().replace(/^-?\d+/g,'');
	var num=(numint||0).toString(),result = '';
	while(num.length > 3){
		result = ','+num.slice(-3)+result;
		num = num.slice(0,num.length - 3);
	}
	if(num){result = num + result;}
	return sign+result+numfloor;
}
	return "<div style='font-size:8px'>"+this.seriesName+":"+Math.floor(this.percentage*100)+"%"+'br/'+toThousands(this.value)+"</div>";
	
}

6.其他功能点陆续补充

- 使用请自取,转发请注明出处

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值