import { defineComponent as u, ref as p, createBlock as d, openBlock as _, mergeProps as h } from "vue";
import { cloneDeep as i } from "lodash";
import v from "../../../../../commons/components/Chart/index.vue.mjs";
import { EchartsUtils as D } from "../../../../../commons/utils/echartsUtils.mjs";
const E = u({ name: "ShjPieIndex" }), w = /* @__PURE__ */ u({
  ...E,
  props: {
    option: {},
    sources: {},
    useEvents: {}
  },
  setup(T, { expose: f }) {
    const l = (e, r, c) => {
      var a, o, n;
      e.__defaultTitle || (e.__defaultTitle = i(e.title.text));
      const m = e.__defaultTitle, t = D.parseDataset(i(r));
      e.dataset = t, e.title.text = (((n = (a = t.source) == null ? void 0 : a[0]) == null ? void 0 : n[(o = t.dimensions) == null ? void 0 : o[1]]) || 0) + m, c(e);
    }, s = p();
    return f({
      getEchartsInstance: () => {
        var e;
        return (e = s.value) == null ? void 0 : e.getEchartsInstance();
      },
      refresh: () => {
        var e;
        return (e = s.value) == null ? void 0 : e.refresh();
      },
      refreshView: () => {
        var e;
        return (e = s.value) == null ? void 0 : e.refreshView();
      },
      refreshData: () => {
        var e;
        return (e = s.value) == null ? void 0 : e.refreshData();
      }
    }), (e, r) => (_(), d(v, h({
      ref_key: "componentRef",
      ref: s,
      option: e.option,
      sources: e.sources,
      "use-events": e.useEvents,
      "is-multi-series": e.option.isMultiSeries,
      "custom-render-data": l
    }, e.$attrs), null, 16, ["option", "sources", "use-events", "is-multi-series"]));
  }
});
export {
  w as default
};
