You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
1.7 KiB

<template>
<view>
<text>这个是User界面</text>
<!-- ECharts 图表 -->
<view style="width: 100%; height: 400px;">
<canvas ref="myChart" style="width: 100%; height: 100%;"></canvas>
</view>
<tarbar_user></tarbar_user>
</view>
</template>
<script>
import * as echarts from 'echarts';
export default {
data() {
return {};
},
onReady() {
this.initChart();
},
methods: {
initChart() {
const chartDom = this.$refs.myChart;
const myChart = echarts.init(chartDom);
const option = {
legend: {
top: 'bottom'
},
toolbox: {
show: true,
feature: {
mark: { show: true },
dataView: { show: true, readOnly: false },
restore: { show: true },
saveAsImage: { show: true }
}
},
series: [
{
name: 'Nightingale Chart',
type: 'pie',
radius: [50, 250],
center: ['50%', '50%'],
roseType: 'area',
itemStyle: {
borderRadius: 8
},
data: [
{ value: 40, name: 'rose 1' },
{ value: 38, name: 'rose 2' },
{ value: 32, name: 'rose 3' },
{ value: 30, name: 'rose 4' },
{ value: 28, name: 'rose 5' },
{ value: 26, name: 'rose 6' },
{ value: 22, name: 'rose 7' },
{ value: 18, name: 'rose 8' }
]
}
]
};
myChart.setOption(option);
},
onResize() {
this.myChart.resize();
}
}
}
</script>
<style lang="scss">
/* 添加样式 */
</style>