首先安装
npm install echarts --save
代码:
<template>
<div id="chart" style="width:100%;height:400px;" ></div>
</template>
<script lang="ts">
import { defineComponent, ref } from "vue";
import * as echarts from 'echarts';
import { onBeforeMount, onMounted, onBeforeUpdate, onUpdated, onBeforeUnmount, onUnmounted, onActivated, onDeactivated, onErrorCaptured } from 'vue'
export default defineComponent({
setup() {
onActivated(() => {
// initialize the echarts instance
var myChart = echarts.init(document.getElementById('chart'));
// Draw the chart
myChart.setOption({
title: {
text: '用户增长图'
},
tooltip: {},
xAxis: {
data: ['shirt', 'cardigan', 'chiffon', 'pants', 'heels', 'socks']
},
yAxis: {},
series: [
{
name: 'sales',
type: 'bar',
data: [5, 20, 36, 10, 10, 20]
}
]
});
})
},
});
</script>
网友回复
WinUI3和Electron有啥不同?
有哪些版权中心可以合作发布短剧漫剧进行赚钱?
ai装修解压视频提示词如何写?
有哪些视频钩子可以解决5s完播低问题?
seedance2如何根据一张九宫格分镜头图片生成ai视频短剧?
www.gstatic.com打开报错net::ERR_TUNNEL_CONNECTION_FAILED
果蝇大脑神经在计算机中复原意味人脑神经和意识也可在计算机中复原?
cosyvoice-v3.5声音克隆报错:Error during speech synthesis: start speech synthesizer failed within 5s.
html如何实现二进制程序转成汇编代码?
python如何通过音色描述和说话内容生成语音?


