"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _react = _interopRequireDefault(require("react"));
require("./index.css");
var _echartsForReact = _interopRequireDefault(require("echarts-for-react"));
var _excluded = ["title", "secondTitle", "name", "data"];
/*
 * @Author: wangrongrong wangrongrong@bigo.sg
 * @Date: 2022-05-27 17:08:35
 * @LastEditors: wangrongrong wangrongrong@bigo.sg
 * @LastEditTime: 2023-03-22 14:06:59
 * @FilePath: /lowcode-material/devopsComponent/src/components/echart-pie-component/echart-pie-component.tsx
 * @Description: 饼图
 */
;
var EchartPieComponent = function EchartPieComponent(props) {
  var title = props.title,
    secondTitle = props.secondTitle,
    name = props.name,
    data = props.data,
    others = (0, _objectWithoutPropertiesLoose2["default"])(props, _excluded);
  var option = {
    title: {
      text: title,
      subtext: secondTitle,
      left: 'center'
    },
    tooltip: {
      trigger: 'item'
    },
    legend: {
      orient: 'vertical',
      left: 'left'
    },
    series: [{
      name: name,
      type: 'pie',
      radius: '50%',
      data: data || [{
        value: 1048,
        name: 'demo数据'
      }],
      emphasis: {
        itemStyle: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'rgba(0, 0, 0, 0.5)'
        }
      }
    }]
  };
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "Echarts"
  }, /*#__PURE__*/_react["default"].createElement(_echartsForReact["default"], {
    option: option
  }));
};
var _default = EchartPieComponent;
exports["default"] = _default;