<template>
  <chart :options="water()" class="water" />
</template>

<script>
import { graphic } from "echarts/lib/export";
export default {
  props: {
    data: {
      type: Object,
      default: () => {
        return {
          xaxis: [],
          data: [],
          legend: []
        };
      }
    }
  },
  data: () => ({}),
  mounted() {},
  methods: {
    water() {
      let self = this;
      return {
        title: [
          {
            text: "支持开发",
            x: "center",
            y: "40%",
            textStyle: {
              fontSize: 14,
              fontWeight: "normal",
              color: "#58617a"
            }
          },
          {
            text: "不支持开发",
            x: "center",
            y: "90%",
            textStyle: {
              fontSize: 14,
              fontWeight: "normal",
              color: "#58617a"
            }
          }
        ],
        series: [
          {
            type: "liquidFill",
            data: [
              {
                name: "A",
                value: 0.67,
                key: 77
              }
            ],
            radius: "50%",
            center: ["50%", "25%"],
            outline: {
              borderDistance: 5,
              itemStyle: {
                borderWidth: 5,
                borderColor: "#e56600",
                shadowBlur: 0
              }
            },
            backgroundStyle: {
              color: "#fff",
              opacity: 1
            },
            itemStyle: {
              color: {
                type: "linear",
                x: 0,
                y: 0,
                x2: 0,
                y2: 1,
                colorStops: [
                  {
                    offset: 1,
                    color: ["#e6ebfe"] // 0% 处的颜色
                  },
                  {
                    offset: 0,
                    color: ["#515fe7"] // 100% 处的颜色
                  }
                ],
                global: false // 缺省为 false
              },
              opacity: 1,
              shadowBlur: 0
            },
            label: {
              normal: {
                formatter: function(param) {
                  return "63%";
                },
                textStyle: {
                  color: "#000",
                  insideColor: "#000",
                  fontSize: 14
                }
              }
            }
          },
          {
            type: "liquidFill",
            data: [
              {
                name: "A",
                value: 0.67,
                key: 77
              }
            ],
            radius: "50%",
            center: ["50%", "75%"],
            outline: {
              borderDistance: 5,
              itemStyle: {
                borderWidth: 5,
                borderColor: "#e56600",
                shadowBlur: 0
              }
            },
            backgroundStyle: {
              color: "#fff",
              opacity: 1
            },
            itemStyle: {
              color: {
                type: "linear",
                x: 0,
                y: 0,
                x2: 0,
                y2: 1,
                colorStops: [
                  {
                    offset: 1,
                    color: ["#e6ebfe"] // 0% 处的颜色
                  },
                  {
                    offset: 0,
                    color: ["#515fe7"] // 100% 处的颜色
                  }
                ],
                global: false // 缺省为 false
              },
              opacity: 1,
              shadowBlur: 0
            },
            label: {
              normal: {
                formatter: function(param) {
                  return "63%";
                },
                textStyle: {
                  color: "#000",
                  insideColor: "#000",
                  fontSize: 14
                }
              }
            }
          }
        ]
      };
    }
  }
};
</script>
<style scoped>
.water {
  width: 100%;
  height: calc(100% - 20px);
}
</style>