- 39
- 0
报错:`TypeError: Cannot use 'in' operator to search for '_ec_inner'
at ExtendedClass.setOption (Global.js?6023:119)
at ECharts.echartsProto.setOption (echarts.js?deac:385)
是数据没拿到之前就渲染的问题吗? 要怎么改 求助
前端
mounted(){
this.$store.dispatch('getThemeData');
this.init();
},
computed:{
...mapGetters(['themeData'])
},
methods:{
init(){
let option={
title : {
text: 'Theme of postings',
x:'center',
textStyle:{
color:'#ccc',
//字体风格,'normal','italic','oblique'
fontStyle:'normal',
//字体粗细 'normal','bold','bolder','lighter',100 | 200 | 300 | 400...
fontWeight:'bold',
//字体系列
fontFamily:'sans-serif',
//字体大小
fontSize:30
}
},
tooltip : {
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
textStyle:{
//字体风格,'normal','italic','oblique'
fontStyle:'normal',
//字体粗细 'normal','bold','bolder','lighter',100 | 200 | 300 | 400...
fontWeight:'normal',
//字体系列
fontFamily:'sans-serif',
//字体大小
fontSize:14
},
orient: 'vertical',
left: 'left',
top:'10%',
data:['Disclosure of air pollution',
'Dissatisfaction with the poor air quality',
'Report of behavioral changes',
'Health concern for his or her health',
'Banter about the poor air quality','Evaluation of government policy',
'Appeal to the government to reduce air pollution']
},
toolbox: {
text:'dsdd',
show : true,
feature : {
mark : {show: true},
magicType : {
show: true,
type: ['pie', 'funnel']
},
restore : {show: true},
saveAsImage : {show: true}
}
},
calculable : true,
series : [
{
name:'Theme of Postings',
type:'pie',
radius : [30, 110],
center : ['50%', '60%'],
roseType : 'area',
data:this.themeData
}
]
}
this.myChart = this.$echarts.init(document.querySelector('.theme .main'));
this.myChart.setOption(this.option)
}
},
vuex管理数据
const getters = {
themeData: (state) => {
return state.theme_data;
},
}
// actions
const actions = {
getThemeData:(context)=>{
axios.get('static/theme.json').then((res)=>{
return res.data.data;
}).then((data)=>{
context.commit('setThemeData',data);
})
}
}
// mutations
const mutations = {
setThemeData:(state,data)=>{
var temp=[];
for(var i=0;i<data.length;i++){
console.log(data[i])
let t={
value:data[i].percent,
name:data[i].theme
}
temp.push(t);
}
state.theme_data=temp;
} 1
打赏
收藏
点击回答
您的回答被采纳后将获得:提问者悬赏的 11 元积分
网站公告
- 扫一扫访问手机版
回答动态

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器更新之后。服务器里面有部分玩家要重新创建角色是怎么回事啊?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题函数计算不同地域的是不能用内网吧?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题ARMS可以创建多个应用嘛?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题在ARMS如何申请加入公测呀?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题前端小程序接入这个arms具体是如何接入监控的,这个init方法在哪里进行添加?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器刚到期,是不是就不能再导出存档了呢?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器的游戏版本不兼容 尝试更新怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器服务器升级以后 就链接不上了,怎么办?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器转移以后服务器进不去了,怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器修改参数后游戏进入不了,是什么情况?预计能赚取 0积分收益
- 回到顶部
- 回到顶部
