<template>
  <div>
    <div :id="sortId" />
  </div>
</template>

<script>
import * as G2 from '@antv/g2'
export default {
  props: ['sortId', 'data'],
  data() {
    return {
      loading: false
    }
  },
  mounted() {
    var data = this.$props.data
    var chart2 = new G2.Chart({
      container: this.$props.sortId,
      forceFit: true,
      width: (window.innerWidth - 400) / 6,
      height: 50
    })
    chart2.source(data)
    chart2.scale('sales', {
      tickInterval: 20
    })
    chart2.interval().position('year*sales')
    chart2.render()
  },
  methods: {
  }
}
</script>

<style scoped>
</style>
