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