"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _echartsForReact = _interopRequireDefault(require("echarts-for-react"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var Wgfx = function Wgfx(props) {
  var _props$data = props.data,
    data = _props$data === void 0 ? [{
      name: '超速',
      value: 2
    }, {
      name: '超速1',
      value: 2
    }, {
      name: '超速2',
      value: 5
    }, {
      name: '超速3',
      value: 4
    }, {
      name: '超速4',
      value: 12
    }, {
      name: '超速5',
      value: 12
    }, {
      name: '超速6',
      value: 12
    }, {
      name: '超速61',
      value: 12
    }, {
      name: '超速62',
      value: 12
    }, {
      name: '超速63',
      value: 12
    }] : _props$data,
    _props$total = props.total,
    total = _props$total === void 0 ? 0 : _props$total;
  window.console.log(data);
  var color = ['#9270CA', '#6DC8EC', '#E8684A', '#F6BD16', '#5D7092', '#5AD8A6', '#5B8FF9', '#FF9D4D'];
  var option = {
    color: color,
    backgroundColor: 'transparent',
    tooltip: {
      show: true,
      trigger: 'item'
    },
    title: {
      zlevel: 0,
      text: '总数',
      top: '33%',
      left: '19%',
      textAlign: 'center',
      textStyle: {
        color: '#D4D4D4',
        fontSize: 14
      },
      subtext: "".concat(total || 0),
      subtextStyle: {
        color: '#fafafa',
        fontSize: 28
      }
    },
    legend: {
      orient: 'vertical',
      left: '50%',
      top: '5%',
      align: 'left',
      itemGap: 8,
      itemWidth: 10,
      itemHeight: 10,
      formatter: function formatter(name) {
        var value = data.find(function (item) {
          return item.name === name;
        });
        if (value) {
          return "\t\t".concat(name, "\t\t").concat(value.value, "\u6B21\t\t");
        } else {
          return '';
        }
      },
      textStyle: {
        fontSize: 14,
        color: '#fff'
      },
      pageIconColor: '#fff',
      pageIconInactiveColor: '#fff',
      pageTextStyle: {
        color: '#fff'
      }
    },
    series: [{
      type: 'pie',
      radius: ['55%', '75%'],
      center: ['20%', '40%'],
      hoverAnimation: true,
      z: 10,
      itemStyle: {
        normal: {
          borderWidth: 2,
          borderColor: '#003359'
        }
      },
      label: {
        show: false
      },
      data: data,
      labelLine: {
        show: false
      }
    }]
  };
  return /*#__PURE__*/_react["default"].createElement(_echartsForReact["default"], {
    option: option,
    notMerge: true,
    lazyUpdate: true,
    style: {
      height: '100%',
      width: '100%'
    }
  });
};
var _default = Wgfx;
exports["default"] = _default;
//# sourceMappingURL=Wgfx.js.map
