<template>
    <div class="ques-piechart">

    <PieChart :option="option" />
    <!--{{"getDataTest:"+this.$data.option.series[0].data[0].value+","}}
    {{this.$data.option.series[0].data[1].value}}-->
  </div>
</template>

<script>
import { PieChart } from "dr-vue-echarts";
export default {
    name:"BasicInfoPieChart",
    components: {
    [PieChart.name]: PieChart,
  },
     data() {
    return {
      option: {
        label: {
          position: "inside",
        },
        tooltip: {
          trigger: "item",
          formatter: "{b} : {c} ({d}%)",
          padding: [4, 12],
          backgroundColor: "white",
          textStyle: {
            color: "black",
            fontFamily: "Ariel",
            fontWeight: "bolder",
          },
        },
        

        series: [
          {
            type: "pie",
            radius: "70%",
            top: "10%",
            bottom: "20%",
            center: ["50%", "60%"],
            itemStyle: {
              shadowColor: "rgba(0, 0, 0, 0.5)",
              shadowBlur: 10,
              shadowOffsetY: 3,
            },
            data: [
              {
                value: 335,
                name: '幽默風趣',
                itemStyle: { color: "#00AD6C" },
                label: {
                   show: window.innerWidth <= 1280&&window.innerWidth>=992 ? false : true,
                  formatter: "{b}: {d}%",
                  fontWeight: "bold",
                  color: "black",
                },
                labelLine: {
                  show: false,
                },
              },
              {
                value: 310,
                name: '善用科技',
                itemStyle: { color: "#006841" },
                label: {
                  show: window.innerWidth <= 1280&&window.innerWidth>=992 ? false : true,
                  formatter: "{b}: {d}%",
                  fontWeight: "bold",
                  color: "black",
                },
                labelLine: {
                  show: false,
                },
              },
              {
                value: 234,
                name: '作業設計',
                itemStyle: { color: "#003E27" },
                label: {
                   show: window.innerWidth <= 1280&&window.innerWidth>=992 ? false : true,
                  formatter: "{b}: {d}%",
                  fontWeight: "bold",
                  color: "black",
                },
                labelLine: {
                  show: false,
                },
              },
              {
                value: 238,
                name: '課堂互動',
                itemStyle: { color: "#24b880" },
                label: {
                   show: window.innerWidth <= 1280&&window.innerWidth>=992 ? false : true,
                  formatter: "{b}: {d}%",
                  fontWeight: "bold",
                  color: "black",
                },
                labelLine: {
                  show: false,
                },
              },
             
            ],
            emphasis: {
              label: {
                show: true,
                formatter: "{b}: {d}%",
                fontWeight: "bold",
                color: "black",
              },
              labelLine: {
                show: false,
              },
              itemStyle: {
                color: "#FA6400",
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: "rgba(0, 0, 0, 0.5)",
              },
            },
          },
        ],
      },
    };
  },

}
</script>

<style scoped>
.ques-piechart{
  width: 100%;
  max-width: 500px;
  margin:auto;
  padding: 15px 40px 0px 40px;
  margin-bottom: 50px;
  height: 320px;
  color: rgba(0, 0, 0, 0.726);
  position: relative;
}
.qnum-text{
  position: absolute;
  font-weight: bolder;
  right: 20px;
  
}
.qnum {
  font-size: 20px;
}
</style>