<script>
export default {
  name: 'UiChartYaxis',
  inject: ['UiChart'],
  props: {
    show: {
      type: Boolean,
      default: true
    },
    /**
     * 纬度数据
    */
    data: {
      type: Array
    }
  },
  computed: {
    options() {
      return {
        show: this.show,
        type: this.data ? 'category' : 'value',
        data: this.data
      }
    }
  },
  created() {
    this.UiChart.setOption('yAxis', this.options)
  },
  render() {
    return null
  }
}
</script>
