Blame view

ant-design-jeecg-vue/src/components/chart/Bar.vue 777 Bytes
1
2
3
<template>
  <div :style="{ padding: '0 0 32px 32px' }">
    <h4 :style="{ marginBottom: '20px' }">{{ title }}</h4>
4
5
6
    <v-chart :forceFit="true" :height="height" :data="dataSource" :padding="padding">
      <v-tooltip/>
      <v-axis/>
7
8
9
10
11
12
      <v-bar position="x*y"/>
    </v-chart>
  </div>
</template>

<script>
13
  import { triggerWindowResizeEvent } from '@/utils/util'
14
15

  export default {
16
    name: 'Bar',
17
    props: {
18
19
20
21
      dataSource: {
        type: Array,
        required: true
      },
22
23
24
      title: {
        type: String,
        default: ''
25
26
27
28
      },
      height: {
        type: Number,
        default: 254
29
30
      }
    },
31
32
33
34
35
    data() {
      return { padding: ['auto', 'auto', '40', '50'] }
    },
    mounted() {
      triggerWindowResizeEvent()
36
37
38
    }
  }
</script>