<template>
  <dv-active-ring-chart  
    :config="config"
    :style="{
      position: 'absolute',
      width: val.width  + '%',
      height: val.height  + '%',
      left: val.left  + '%',
      top: val.top  + '%',
      zIndex: val.z,
      backgroundColor: val.bgColor
    }"
  />
</template>

<script>

import stylec from "./style.vue";
const WIDGET_NAME = "dataV-dynamicir";
const option = {
  radius: '40%',
    activeRadius: '45%',
    color: ['#37a2da', '#32c5e9', '#67e0e3', '#9fe6b8', '#ffdb5c', '#ff9f7f', '#fb7293'],
    data: [{name: '周口', value: 55 },
            {name: '南阳',value: 120},
            {name: '西峡',value: 78},
            {name: '驻马店',value: 66},
            {name: '新乡',value: 80}],
    digitalFlopStyle: {
        fontSize: 20
     },
}
export default {
  name: WIDGET_NAME,
  props: ["h", "val", "playState", "w"],
  data() {
    return {
      config:{}
    };
  }, 
  icon: {
    type: "ios-nuclear"
  },
  title: "动态环状图",
  panel: stylec,
  setting: {
    type: WIDGET_NAME,
    isContainer: true,
    isUpload: false,
    hasGuide: true,
    isChild: true,
    draggable: true,
    resizable: true,
    name: "动态环状图",
    width: 30,
    height: 30,
    left: 10,
    offsetLeft: 10,
    offsetTop: 10,
    offsetWidth: 100,  // 父组件相对于page的百分比
    offsetHeight: 100, // 父组件相对于page的百分比
    z: 0,
    bgColor: '#00265f',
    backPic: "",
    backPicUrl: "",
    text: "动态环状图",
    belong: "page",
    animationName: "",
    option: option
  },
   watch: {
    val: {
      handler: function (newValue, oldval) {
        this.config = newValue.option
        // console.log( this.config,999999)
        this.config={...this.config} //
      },
      deep: true// 对象内部的属性监听，也叫深度监听
    }
  },
  mounted(){
    console.log(this.val,6666666)
    this.config = this.val.option
  }
};
</script>

<style scoped>
</style>
