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