44 lines
871 B
Vue
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>
|