airyland / airyland/vux

[Bug Report] v-chart 数据可以显示,但是图表显示不出来

Open
#3,451 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vue
Stars
17.5k
Forks
3.6k
PR merge metrics
No merged PRs in 30d

Description

### VUX version
2.9.2

### OS/Browsers version
windows10/chrome64 73.0.3683.103

### Vue version
2.6.8

### Code

```html

data() {
return {
resultInfos: {
zhpf1: '',
zhpf2: '',
zhpf3: '',
totalscore: '',
cwrecord: '',
},
}
}
methods: {
renderVChart({ chart }){
setTimeout(() => {
const dataArr = [
{ name: '知识产权', percent: this.resultInfos.zhpf1, a: '1' },
{ name: '成果转化', percent: this.resultInfos.zhpf2, a: '1' },
{ name: '管理水平', percent: this.resultInfos.zhpf3, a: '1' },
{ name: '财务成长性', percent: this.resultInfos.cwrecord, a: '1' }
]
const map = {};
dataArr.map(function(obj) {
map[obj.name] = obj.percent '分';
});
chart.source(dataArr);
chart.tooltip(false);
chart.legend({
position: 'right',
itemFormatter(val) {
return val ' ' map[val];
}
});
chart.coord('polar', {
transposed: true,
innerRadius: 0.7,
radius: 0.85
});
chart.axis(false);
chart.interval().position('a*percent').color('name', ['#FFFF00','#FF00FE','#0000FE','#737DDE']).adjust('stack');
chart.guide().html({
position: ['50%', '45%'],
html: `


总分

` this.resultInfos.totalscore `分

`
});
chart.render();
}, 1000)

},
}
```

### Steps to reproduce
数据写死的话,图表可以显示;但换成在方法中计算过的数据后就显示不出来

### What is Expected?
希望图表能显示

### What is actually happening?
图表的数据都显示出来了,就是图表不显示

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.