ny
昨天 282fbc6488f4e8ceb5fda759f963ee88fbf7b999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<script lang="ts" setup>
import type { EchartsUIType } from '@vben/plugins/echarts';
 
import { onMounted, ref } from 'vue';
 
import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
 
const chartRef = ref<EchartsUIType>();
const { renderEcharts } = useEcharts(chartRef);
 
onMounted(() => {
  renderEcharts({
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        lineStyle: {
          width: 1,
          color: '#019680',
        },
      },
    },
    grid: { left: '1%', right: '1%', top: '2  %', bottom: 0, containLabel: true },
    xAxis: {
      type: 'category',
      data: Array.from({ length: 12 }).map((_item, index) => `${index + 1}月`),
    },
    yAxis: {
      type: 'value',
      max: 8000,
      splitNumber: 4,
    },
    series: [
      {
        data: [3000, 2000, 3333, 5000, 3200, 4200, 3200, 2100, 3000, 5100, 6000, 3200, 4800],
        type: 'bar',
        barMaxWidth: 80,
        color: 'rgba(24,144,255,0.8)',
      },
    ],
  });
});
</script>
 
<template>
  <EchartsUI ref="chartRef" />
</template>