<template>
  <div>
    <hr />
    
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">柱数据</div>
      <div class="panel-value" >
          <Input v-model="data" @on-change="dataChange(data)"/>
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">柱顶图片url</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.img" />
      </div>
    </div>
    
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">文字大小</div>
      <div class="panel-value">
          <Input v-model="activeElement.option.fontSize" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">图片边长</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.imgSideLength" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">柱颜色</div>
      <div class="panel-value">
          <Input v-model="activeElement.option.columnColor" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">文字颜色</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.textColor" />
      </div>
    </div>
    <div class="panel-row">
      <vpd-icon name="target" />
      <div class="panel-label">显示数值</div>
      <div class="panel-value">
        <Input v-model="activeElement.option.showValue" />
      </div>
    </div>
  </div>
  
</template>

<script>
export default {
  name: "DataVConicalcolumnStyle",
  props: ["activeElement"],
  data() {
    return {
      data:JSON.stringify(this.activeElement.option.data)
    };
  },
  methods: {
    dataChange(newCode) {
      this.activeElement.option.data = JSON.parse(newCode);
      this.$parent.$vpd.commit("updateWidgets", this.activeElement);
    }
  },
  created () {
      // console.log(this.data,typeof(this.data),8888)
      // console.log(this.colors,typeof(this.colors),8888)
  }
};
</script>
