screenFront/src/views/MicroExhibition/components/BarChart.vue
2023-08-24 18:10:09 +08:00

44 lines
871 B
Vue

<template>
<div ref="LChartRef"></div>
</template>
<script setup lang='ts'>
import { ref, getCurrentInstance, onMounted } from 'vue'
let LChartRef = ref(null);
const { proxy } = getCurrentInstance() as any;
let charts = null;
const setCharts = () => {
charts = proxy.$echarts.init(LChartRef.value, 'dark')
let option = {
title:{
text:'工作时间'
},
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [
{
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar'
}
]
};
charts.setOption(option);
}
onMounted(() => {
setCharts()
})
</script>
<style scoped>
.cc {
width: 400px;
height: 400px;
}
</style>