echarts
echarts copied to clipboard
Echarts 图表消失问题
One-line summary [问题简述]
(假设现在在使用谷歌浏览器)图表生成后,切换其他浏览器或者切换其他客户端,又或者切换至桌面,然后在切换回谷歌,图表就会消失,但是鼠标移入图表位置还是有信息弹出,比如我有个柱状图,消失后移入鼠标到原柱状图的位置,鼠标右下角还是会有小窗口弹出,所以大致可以理解为图表“看不见”,但是的确还存在着。 不清楚是Echarts的问题还是自己代码本身问题
Version & Environment [版本及环境]
- ECharts version [ECharts 版本]: Echatrs 版本3.8.4
- Browser version [浏览器类型和版本]:谷歌浏览器 版本 62.0.3202.62
- OS Version [操作系统类型和版本]:win 10 64位
Expected behaviour [期望结果]
希望能解决“不显”的问题
ECharts option [ECharts配置项]
// 基于准备好的dom,初始化echarts图表
var myChart = echarts.init(document.getElementById('main'));
var myChart1 = echarts.init(document.getElementById('main1'));
//柱状图
var option = {
title : {
text: '酒店客房用品市场规模(亿元)',
subtext: '',
x:'center',
bottom:'bottom'
},
tooltip: {
show: true,
},
xAxis : [
{
splitLine : false, //去掉X横线
type : 'category',
data : ["2006","2007","2008","2009","2010","2011","2012","2013","2014","2015"]
}
],
yAxis : [
{
splitLine : false, //去掉Y纵线
splitNumber : '12',
type : 'value',
data : ["0","500","1500","2000","2500","3000","3500","4000","4500","5000","5500","6000"]
}
],
series : [
{
"name":"销量",
"type":"bar",
"data":[1500,1600,1750,2000,2250,2500,3000,3200,4250,5000],
itemStyle: {
normal: {
color: function(params) {
var colorList = [
'#C1232B','#B5C334','#FCCE10','#E87C25','#27727B',
'#FE8463','#9BCA63','#FAD860','#F3A43B','#60C0DD'
];
return colorList[params.dataIndex]
},
//以下为是否显示,显示位置和显示格式的设置了
label: {
show: false,
position: 'top',
formatter: '{b}\n{c}'
}
}
}
}
]
};
//柱状图
//饼图
option1 = {
title : {
text: '中国情趣用品市场份额',
subtext: '',
x:'center',
bottom:'bottom'
},
tooltip : {
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
orient: 'horizontal',
bottom:'50',
data: ['“剩男”的生理需求(亿)','性生活质量的提高(亿)','情趣内衣市场(亿)','安全套市场(亿)','男性滋补市场(亿)'],
padding: [20,40],
center:'center'
},
series : [
{
name: '访问来源',
type: 'pie',
radius : '55%',
center: ['50%', '50%'],
data:[
{value:30, name:'“剩男”的生理需求(亿)'},
{value:81, name:'性生活质量的提高(亿)'},
{value:50, name:'情趣内衣市场(亿)'},
{value:100, name:'安全套市场(亿)'},
{value:200, name:'男性滋补市场(亿)'}
],
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
},
normal:{ //饼图中显示数据
label:{
show: true,
position: 'inner',
formatter: '{c} ({d}%)'
}
}
},
labelLine: {
normal:{
show: false //延伸线
}
},
hoverAnimation:false,
legendHoverLink:false,
narkPoint:{
silent:false
}
}
]
};
//饼图
// 为echarts对象加载数据
myChart.setOption(option);
myChart1.setOption(option1);
Other comments [其他信息]
同样问题,手机web,页面往下滑动,然后在回到echarts的地方,图表消失了
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.