import "../../../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import B from "../../../../../../../../node_modules/.pnpm/vue-echarts@6.6.1_echarts@5.4.3_vue@3.3.4/node_modules/vue-echarts/dist/index.esm.min.mjs";
import { option } from "./barOptions.mjs";
import { option as option$1 } from "./lineOptions.mjs";
import { defineComponent, watch, resolveComponent, openBlock, createBlock, withCtx, createVNode, createCommentVNode } from "../../../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
import { use } from "../../../../../../../../node_modules/.pnpm/echarts@5.4.3/node_modules/echarts/lib/extension.mjs";
import { install } from "../../../../../../../../node_modules/.pnpm/echarts@5.4.3/node_modules/echarts/lib/component/dataset/install.mjs";
import { install as install$1 } from "../../../../../../../../node_modules/.pnpm/echarts@5.4.3/node_modules/echarts/lib/renderer/installCanvasRenderer.mjs";
import { install as install$2 } from "../../../../../../../../node_modules/.pnpm/echarts@5.4.3/node_modules/echarts/lib/chart/bar/install.mjs";
import { install as install$3 } from "../../../../../../../../node_modules/.pnpm/echarts@5.4.3/node_modules/echarts/lib/chart/line/install.mjs";
import { install as install$4 } from "../../../../../../../../node_modules/.pnpm/echarts@5.4.3/node_modules/echarts/lib/component/grid/install.mjs";
import { install as install$5 } from "../../../../../../../../node_modules/.pnpm/echarts@5.4.3/node_modules/echarts/lib/component/tooltip/install.mjs";
import { install as install$6 } from "../../../../../../../../node_modules/.pnpm/echarts@5.4.3/node_modules/echarts/lib/component/legend/install.mjs";
import { ref, unref } from "../../../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    color: {
      type: Array,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    use([install, install$1, install$2, install$3, install$4, install$5, install$6]);
    const barOption = ref();
    const lineOption = ref();
    const chartStyle = {
      width: "528px",
      height: "200px"
    };
    watch(
      () => props.color,
      (newData) => {
        barOption.value = option(newData);
        lineOption.value = option$1(newData);
      },
      {
        immediate: true,
        deep: true
      }
    );
    return (_ctx, _cache) => {
      const _component_n_tab_pane = resolveComponent("n-tab-pane");
      const _component_n_tabs = resolveComponent("n-tabs");
      const _component_n_card = resolveComponent("n-card");
      const _component_n_space = resolveComponent("n-space");
      return openBlock(), createBlock(_component_n_space, null, {
        default: withCtx(() => [
          barOption.value ? (openBlock(), createBlock(_component_n_card, {
            key: 0,
            class: "go-mt-3",
            bordered: false,
            role: "dialog",
            size: "small",
            "aria-modal": "true"
          }, {
            default: withCtx(() => [
              createVNode(_component_n_tabs, {
                type: "segment",
                size: "small",
                animated: ""
              }, {
                default: withCtx(() => [
                  createVNode(_component_n_tab_pane, {
                    name: "柱状图",
                    tab: "柱状图"
                  }, {
                    default: withCtx(() => [
                      createVNode(unref(B), {
                        ref: "vChartRefBar",
                        theme: { color: __props.color },
                        option: barOption.value,
                        "manual-update": true,
                        autoresize: "",
                        style: chartStyle
                      }, null, 8, ["theme", "option"])
                    ]),
                    _: 1
                  }),
                  createVNode(_component_n_tab_pane, {
                    name: "折线图",
                    tab: "折线图"
                  }, {
                    default: withCtx(() => [
                      createVNode(unref(B), {
                        ref: "vChartRefLine",
                        theme: { color: __props.color },
                        option: lineOption.value,
                        "manual-update": true,
                        autoresize: "",
                        style: chartStyle
                      }, null, 8, ["theme", "option"])
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              })
            ]),
            _: 1
          })) : createCommentVNode("", true)
        ]),
        _: 1
      });
    };
  }
});
export {
  _sfc_main as default
};
