中医药大学课题数据库系统
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.
 
 
 
 
 

83 lines
2.0 KiB

<template>
<!-- <div>数据统计组件</div> -->
<div style="width: 100%; height: 300px" class="chart-box">
<div id="Treemap" style="height: 300px"></div>
</div>
</template>
<script>
export default {
name: 'Treemap',
data() {
return {
// msg: 'Welcome to Your Vue.js App',
width: '',
height: '',
timer: null,
};
},
mounted() {
this.drawLine();
this.timer = setInterval(() => {
this.drawLine();
}, 10000);
let wh = window.innerWidth;
let hg = window.innerHeight;
this.width = wh + 'px';
this.height = hg + 'px';
console.log(this.height);
window.onresize = () => {
return (() => {
wh = window.innerWidth;
hg = window.innerHeight;
this.width = wh + 'px';
this.height = hg + 'px';
})();
};
},
destroyed() {
clearInterval(this.timer);
},
methods: {
async drawLine() {
// 基于准备好的dom,初始化echarts实例
let myChart = this.$echarts.init(document.getElementById('Treemap'));
// 绘制图表
var option = {
tooltip: { trigger: 'axis' },
radar: [
{
indicator: [
{ text: '未完成', max: 100 },
{ text: '已完成', max: 100 },
{ text: '进行中', max: 100 },
{ text: '废弃', max: 100 },
],
center: ['50%', '50%'],
radius: 120,
},
],
series: [
{
type: 'radar',
tooltip: {
trigger: 'item',
},
areaStyle: { color: 'rgba(84,112,198,0.9)' },
lineStyle: { color: 'rgb(84,112,198)' },
itemStyle: { color: 'rgb(84,112,198)' },
data: [
{
value: [80, 80, 60, 40],
name: '病例统计',
},
],
},
],
};
myChart.setOption(option);
},
},
};
</script>
<style lang="stylus" scoped ></style>