搞好了,app是支持的,需要设置一下style。然后介绍那里的内容作者得改一下了。。
<template>
<view class="container">
<view class="container-wrap">
<echarts ref="echarts" :option="option" canvasId="echarts"></echarts>
</view>
</view>
</template>
<script>
import echarts from '@/components/echarts-uniapp/echarts-uniapp.vue'
export default {
components:{echarts},
data() {
return {
option: {}
}
},
onReady() {
this.option = {
backgroundColor: "#ffffff",
series: [{
label: {
normal: {
fontSize: 14
}
},
type: 'pie',
center: ['50%', '50%'],
radius: ['0%', '40%'],
data: [{
value: 55,
name: '北京'
}, {
value: 20,
name: '武汉'
}, {
value: 10,
name: '杭州'
}, {
value: 20,
name: '广州'
}, {
value: 38,
name: '上海'
}]
}]
};
}
}
</script>
<style>
.container {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
}
.container-wrap {
width: 100%;
height: 100%;
}
</style>
1 个回复
2***@qq.com (作者)
搞好了,app是支持的,需要设置一下style。然后介绍那里的内容作者得改一下了。。