基于vue3,EChart5.4.3版本
Line

-
- <template>
- <div class="wh-full" ref="chart">div>
- template>
-
- <style scoped>
-
- style>
Bar

-
- <template>
- <div class="wh-full" ref="chart">div>
- template>
-
- <style scoped>
-
- style>
-
- <template>
- <div class="wh-full" ref="chart">div>
- template>
-
- <style scoped>
-
- style>
使用
- <Line
- class="w-[calc(100%-30px)] h-[calc(100%-40px)] ml-15"
- :chartXData="chartXLineData"
- :seriesData="seriesLineData"
- :seriesNameList="seriesNameList"
- stack="stack1"
- symbol="rect"
- :title="`服务访问总数 ${titleData}`"
- top-grid="50"
- :isSmooth="true"
- >Line>
-
- <script lang="ts" setup>
- import {onMounted, ref} from "vue"
- import Line from '../Line.vue'
-
- onMounted(() => {
- init();
- })
-
- const chartXLineData = ref([])
- const seriesNameList = ref(["", '', ''])
- const seriesLineData = ref
([]) - const lineColorList = ["rgba(1, 145, 219, 1)", 'rgba(9, 162, 51, 1)', "rgba(191, 153, 18, 1)"]
- const seriesList = []
-
- script>
- <style lang="scss" scoped>
-
- style>