<template>
  <div>
    <xlm-bar-chart :data="data" :config="config" />
  </div>
</template>

<script>

export default {
  data() {
    return {
      data: [],
      config: {
        y: {
          name: '单位:万元',
          tickCount: 7
        },
        x: {
          tickCount: 6
        },
        color: 'name',
        colorList: ['#634fff', '#cc4455'],
        title: '数据统计',
        tooltip: true,
        xScroll: true,
        group: true
      },
      width: '500',
      height: '400'
    }
  },
  created() {
    setTimeout(() => {
      this.data = [
        {
          year: '1951 年',
          sales: 38,
          name: 'a'
        }, {
          year: '1952 年',
          sales: 52,
          name: 'a'
        }, {
          year: '1956 年',
          sales: 61,
          name: 'a'
        }, {
          year: '1957 年',
          sales: 145,
          name: 'a'
        }, {
          year: '1958 年',
          sales: 48,
          name: 'a'
        }, {
          year: '1959 年',
          sales: 38,
          name: 'a'
        }, {
          year: '1960 年',
          sales: 38,
          name: 'a'
        }, {
          year: '1962 年',
          sales: 38,
          name: 'a'
        }, {
          year: '1951 年',
          sales: 38,
          name: 'b'
        }, {
          year: '1952 年',
          sales: 52,
          name: 'b'
        }, {
          year: '1956 年',
          sales: 61,
          name: 'b'
        }, {
          year: '1957 年',
          sales: 145,
          name: 'b'
        }, {
          year: '1958 年',
          sales: 48,
          name: 'b'
        }, {
          year: '1959 年',
          sales: 38,
          name: 'b'
        }, {
          year: '1960 年',
          sales: 38,
          name: 'b'
        }, {
          year: '1962 年',
          sales: 38,
          name: 'b'
        }
      ]
    }, 1000)
  }
}
</script>
