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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<script lang="ts" setup>
import type { EchartsUIType } from '@vben/plugins/echarts';
 
import { onMounted, ref } from 'vue';
 
import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
 
defineOptions({ name: 'ExtendGraphDemoEchartsBarAcross' });
 
const chartRef = ref<EchartsUIType>();
const { renderEcharts } = useEcharts(chartRef);
 
const options: any = {
  title: {
    text: '世界人口总量',
    subtext: '网络数据',
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'shadow',
    },
  },
  legend: {
    data: ['2017年', '2018年'],
  },
  grid: {
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true,
  },
  xAxis: {
    type: 'value',
    boundaryGap: [0, 0.01],
  },
  yAxis: {
    type: 'category',
    data: ['巴西', '印尼', '美国', '印度', '中国', '世界人口(人)'],
  },
  series: [
    {
      name: '2017年',
      type: 'bar',
      data: [205290000, 257740000, 322760000, 1304200000, 1405372834, 7500000000],
    },
    {
      name: '2018年',
      type: 'bar',
      data: [210867954, 266794980, 326766748, 1354051854, 1394102196, 7577908055],
    },
  ],
};
 
onMounted(() => {
  renderEcharts(options);
});
</script>
<template>
  <div class="jnpf-content-wrapper">
    <div class="jnpf-content-wrapper-center bg-white px-[10px] pt-[40px]">
      <EchartsUI ref="chartRef" height="500px" />
    </div>
  </div>
</template>