Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yAxis设置max在特殊数据下导致的IE11显示问题 #5777

Closed
CYvonne opened this issue May 18, 2017 · 2 comments
Closed

yAxis设置max在特殊数据下导致的IE11显示问题 #5777

CYvonne opened this issue May 18, 2017 · 2 comments

Comments

@CYvonne
Copy link

CYvonne commented May 18, 2017

One-line summary [问题简述]

如题,当我设置了yAixis[1]的max为100(即变量y2Max),myData2 = [82,71,79,84,99,89,89];(存在一个值大于92的项)时,在IE11会报错"意外地调用了方法或属性...",并且图表显示错误。可以把下面代码放到IE11下的官方示例在线运行看一下。

在chrome下没问题。

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]:
  • Browser version [浏览器类型和版本]:
  • OS Version [操作系统类型和版本]:

Expected behaviour [期望结果]

正常显示

ECharts option [ECharts配置项]

 var y1Max = 100, y2Max = 100;
 var myxAxisData = ['05-11','05-12','05-13','05-14','05-15','05-16','05-17'];
 var myData1 = [28,25,27,26,33,33,33];
 var myData2 = [82,71,79,84,99,89,89];

option = {
	 title: {
		text: '最近一周趋势',
		textStyle: {
			fontWeight: 'bold',
			fontSize: 12
		},
		padding: [15, 0, 0, 0]
	},
	legend: {
		data: ['数量', '比例'],
		right: 0,
		padding: [15, 0, 0, 0]
	},
	xAxis: {
		data: myxAxisData,
		axisLabel: {
			textStyle: {
				color: '#000'
			}
		},
		axisTick: {
			show: true
		},
		axisLine: {
			show: true
		},
		z: 10
	},
	yAxis: [{
		type: 'value',
		name: '数量',
		min: 0,
		max: y1Max,
		position: 'left',
		splitLine: {
			show: false
		}
	}, {
		type: 'value',
		name: '比例',
		min: 0,
		max: y2Max,
		position: 'right',
		axisLabel: {
			formatter: '{value}%'
		},
		offset: -6,
		splitLine: {
			show: false
		}
	}],
	series: [{
		name: '数量',
		type: 'bar',
		barWidth: 18,
		yAxisIndex: 0,
		label: {
			normal: {
				color: '#73cafd',
				show: true,
				position: 'top'
			}
		},
		itemStyle: {
			normal: {
				color: '#73cafd'
			}
		},
		data: myData1
	}, {
		name: '比例',
		type: 'line',
		yAxisIndex: 1,
		label: {
			normal: {
				textStyle: {
					color: '#999',
				},
				show: true,
				position: 'top',
				formatter: '{c}%'
			}
		},
		lineStyle: {
			normal: {
				color: '#999',
				width: 3,
				shadowColor: 'rgba(0,0,0,0.4)',
				shadowBlur: 10,
				shadowOffsetY: 10
			}
		},
		data: myData2
	}]
}

Other comments [其他信息]

e jpg

@100pah
Copy link
Member

100pah commented Jul 10, 2017

ie11 的 canvas 中,clip 和 shadow 同时使用的时候,在完全 clip 的时候可能抛出这个异常。
暂时避开方式:

series: [{
    ...
}, {
    name: '比例',
    type: 'line',
    animationDuration: 0,  // 加上这句
    ...
}]

后续在 ie11 下兼容下这个问题。

@100pah 100pah closed this as completed in c935385 Jul 10, 2017
@CYvonne
Copy link
Author

CYvonne commented Jul 17, 2017

确实,给series[1]去掉shadow或者设置clipOverflow:false都能正常显示。不过你们解决得太慢了,项目都做完了;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants