import {
  shufflTableStyle,
  crosstabStyle,
  metricCardStyle,
  imageContent,
  progressContent,
  selectFilterContent,
  dateFilterContent,
  numberFilterContent,
} from "./customCom";
import { textContent } from "./comConfigs/textContent";
import { waveInstrument } from "./comConfigs/waveInstrument";
import { DEFAULT_FONT, DEFAULT_COLOR } from "@/constants";
import { getColor, getColorQueue } from "./colors.js";
const header = {
  show: true,
  textStyle: {
    fontFamily: DEFAULT_FONT,
    fontStyle: "normal",
    fontWeight: "600",
    color: "#1B2532",
    fontSize: 14,
  },
  // backgroundColor: DEFAULT_COLOR_HEADER,
  backgroundColor: "#ffffff00",
};
// const base = {
//   x: 0,
//   y: 0,
//   w: 6,
//   h: 6,
//   i: 0,
// };
export const body = {
  show: false,
  backgroundColor: DEFAULT_COLOR,
  border: {
    width: 1,
    color: DEFAULT_COLOR,
    radius: 0,
  },
};
const xAxis = {
  show: true,
  type: "category",
  name: "",
  nameLocation: "end",
  nameGap: 3,
  axisLabel: {
    show: true,
    color: "#9BA7BA",
    fontSize: 12,
    // align: 'center',
    fontWeight: "normal",
    fontStyle: "normal",
    overflow: "truncate",
    ellipsis: "...",
    width: 100,
    rotate: "0",
    fontFamily: DEFAULT_FONT,
    padding: 5,
    showMaxLabel: true,
    showMinLabel: true,
  },
  axisLine: {
    show: true,
    lineStyle: {
      color: "#E1E5EB",
      type: "solid",
      width: 1,
    },
  },
  axisTick: {
    show: false,
    lineStyle: {
      color: "#595959",
      type: "solid",
      width: 1,
    },
    length: 5,
    inside: false,
  },
  splitNumber: 4,
  splitLine: {
    show: false,
  },
};

const yAxis = {
  show: true,
  type: "value",
  name: "",
  nameGap: 3,
  axisLabel: {
    show: true,
    color: "#9BA7BA",
    fontSize: 12,
    fontFamily: DEFAULT_FONT,
    fontWeight: "normal",
    fontStyle: "normal",
    overflow: "truncate",
    ellipsis: "...",
    width: 100,
    align: "right",
    rotate: "0",
  },
  axisLine: {
    show: true,
    lineStyle: {
      color: "#E1E5EB",
      type: "solid",
      width: 1,
    },
  },
  axisTick: {
    show: false,
    lineStyle: {
      color: "#9BA7BA",
      type: "solid",
      width: 1,
    },
    length: 5,
    inside: false,
  },
  splitNumber: 4,
  splitLine: {
    show: true,
    lineStyle: {
      color: "#DDE0E5",
      type: "dashed",
    },
  },
  // nameLocation: "center",
  // nameTextStyle: {
  //   padding: 30,
  //   color: "#333"
  // }
};

const legend = {
  show: true,
  type: "scroll",
  textStyle: {
    color: "#9BA7BA",
    fontSize: 12,
    fontWeight: "normal",
    fontFamily: DEFAULT_FONT,
  },
  itemWidth: 12,
  itemHeight: 12,
  icon: "circle",
  left: "center",
  top: "top",
  itemGap: 16,
  orient: "horizontal",
};

const tooltip = {
  show: true,
  textStyle: {
    color: "#999999",
    fontSize: 14,
    fontFamily: DEFAULT_FONT,
    fontWeight: "normal",
  },
  backgroundColor: "#ffffff",
  borderColor: "#4782f4",
  borderWidth: 1,
  borderRadius: 4,
  position: "top",
  confine: true,
  trigger: "item",
  axisPointer: {
    type: "shadow",
  },
};

export const label = {
  show: false,
  color: "#999999",
  fontSize: 12,
  backgroundColor: "",
  borderColor: "#4782f4",
  borderWidth: 0,
  borderType: "solid",
  position: "top",
  borderRadius: 4,
  // padding: 4,
  fontFamily: DEFAULT_FONT,
  fontWeight: "normal",
  // align: 'left',
  // overflow: 'break'
};

const grid = {
  show: false,
  containLabel: true,
  left: 6,
  bottom: 6,
  top: 28,
  right: 6,
};

export const markLine = {
  data: [
    {
      name: "基准线",
      yAxis: "",
      lineStyle: {
        color: "#999999",
        width: 1,
        type: "solid",
      },
      label: {
        color: DEFAULT_COLOR,
        fontSize: 14,
        fontFamily: DEFAULT_FONT,
        borderWidth: 0,
        backgroundColor: "",
        position: "start",
      },
    },
  ],
};

const series = {
  large: true,
  progressive: 400,
};

// 额外参数
const rest = {
  dora_series: 0,
};

// const dataZoom = [
//   {
//       type:'slider',//slider表示有滑动块的，inside表示内置的
//       show:true,
//       xAxisIndex:[0],
//       start:10,
//       end:35
//   }
// ]
export default {
  // 多组折线图
  groupLine: {
    header: {
      ...header,
      text: "线图",
    },
    body,
    // base,
    options: {
      ...rest,
      color: getColorQueue(0),
      xAxis: {
        ...xAxis,
      },
      yAxis: yAxis,
      legend: {
        ...legend,
        // left: '10',
      },
      tooltip: {
        ...tooltip,
        trigger: "axis",
      },

      grid: grid,
      dataset: {
        dimensions: ["类目", "系列1", "系列2"],
        source: [
          {
            类目: "02",
            系列1: 110,
            系列2: 85,
          },
          {
            类目: "03",
            系列1: 120,
            系列2: 105,
          },
          {
            类目: "04",
            系列1: 115,
            系列2: 100,
          },
        ],
      },
      series: [
        {
          type: "line",
          smooth: true,
          lineStyle: {
            color: getColor(0),
            width: 2,
            type: "solid",
          },
          itemStyle: {
            // 拐点颜色
            color: getColor(0),
          },
          showSymbol: true,
          symbol: "circle",
          symbolSize: 8,
          markLine: markLine,
          label: {
            ...label,
            show: false,
          },
          tooltip: {},
          ...series,
        },
        {
          type: "line",
          smooth: true,
          lineStyle: {
            color: "#1BCF9A",
            width: 2,
            type: "solid",
          },
          itemStyle: {
            // 拐点颜色
            color: "#1BCF9A",
          },
          showSymbol: true,
          symbol: "circle",
          symbolSize: 8,
          markLine: markLine,
          label: {
            ...label,
            show: false,
          },
          tooltip: {},
          ...series,
        },
      ],
    },
  },
  // 分组柱状图
  groupBar: {
    header: {
      ...header,
      text: "柱图",
    },
    body,
    // base,
    options: {
      ...rest,
      color: getColorQueue(),
      xAxis: xAxis,
      yAxis: yAxis,
      legend: {
        ...legend,
        // left: '10',
      },
      //已入series
      // label: label,
      tooltip: {
        ...tooltip,
        trigger: "axis",
      },
      grid: grid,
      dataset: {
        dimensions: ["类目", "系列1", "系列2"],
        source: [
          {
            类目: "02",
            系列1: 110,
            系列2: 85,
          },
          {
            类目: "03",
            系列1: 120,
            系列2: 105,
          },
          {
            类目: "04",
            系列1: 115,
            系列2: 100,
          },
        ],
      },
      series: [
        {
          type: "bar",
          itemStyle: {
            color: getColor(0),
            borderRadius: 0,
            borderWidth: 0,
            borderColor: getColor(0),
          },
          barWidth: "40%",
          label: {
            ...label,
            show: false,
          },
          markLine: markLine,
          tooltip: {},
          ...series,
        },
        {
          type: "bar",
          itemStyle: {
            color: getColor(0),
            borderRadius: 0,
            borderWidth: 0,
            borderColor: getColor(0),
          },
          barWidth: "40%",
          label: {
            ...label,
            show: false,
          },
          markLine: markLine,
          tooltip: {},
          ...series,
        },
      ],
    },
  },
  tranGroupBar: {
    header: {
      ...header,
      text: "横向柱状图",
    },
    body,
    // base,
    options: {
      ...rest,
      color: [...getColorQueue()],
      xAxis: {
        ...yAxis,
        axisLabel: {
          ...yAxis.axisLabel,
          align: "center",
          showMaxLabel: true,
          showMinLabel: true,
        },
        axisLine: {
          ...yAxis.axisLine,
        },
        axisTick: {
          ...yAxis.axisTick,
        },
        splitNumber: 4,
        splitLine: {
          show: true,
          lineStyle: {
            color: "#99999980",
            type: "dashed",
          },
        },
      },
      yAxis: {
        ...xAxis,
        axisLabel: {
          ...xAxis.axisLabel,
          // align: 'right',
          fontSize: 10,
          showMaxLabel: true,
          showMinLabel: true,
        },
        axisTick: {
          ...xAxis.axisTick,
        },
        splitNumber: 4,
        splitLine: {
          show: false,
        },
      },
      legend: {
        ...legend,
        // left: '8',
        // top: '12',
      },
      //已入series
      // label: label,
      tooltip: {
        ...tooltip,
        trigger: "axis",
      },
      grid: grid,
      dataset: {
        dimensions: ["类目", "系列1", "系列2"],
        source: [
          {
            类目: "02",
            系列1: 110,
            系列2: 85,
          },
          {
            类目: "03",
            系列1: 120,
            系列2: 105,
          },
          {
            类目: "04",
            系列1: 115,
            系列2: 100,
          },
        ],
      },
      series: [
        {
          type: "bar",
          itemStyle: {
            color: getColor(0),
            borderRadius: 0,
            borderWidth: 0,
            borderColor: getColor(0),
          },
          barWidth: 8,
          label: {
            ...label,
            show: false,
          },
          markLine: {
            data: [
              {
                name: "基准线",
                xAxis: "",
                lineStyle: {
                  ...markLine.data[0].lineStyle,
                },
                label: {
                  ...markLine.data[0].label,
                },
              },
            ],
          },
          tooltip: {},
          ...series,
        },
        {
          type: "bar",
          itemStyle: {
            color: "#59CB74",
            borderRadius: 0,
            borderWidth: 0,
            borderColor: "#59CB74",
          },
          barWidth: 8,
          label: {
            ...label,
            show: false,
          },
          markLine: {
            data: [
              {
                name: "基准线",
                xAxis: "",
                lineStyle: {
                  ...markLine.data[0].lineStyle,
                },
                label: {
                  ...markLine.data[0].label,
                },
              },
            ],
          },
          tooltip: {},
          ...series,
        },
      ],
    },
  },
  // 饼图
  pie: {
    header: {
      ...header,
      text: "饼图",
    },
    body,
    // base,
    options: {
      mergeData: {
        show: true,
        value: 1,
      },
      ...rest,
      color: [...getColorQueue()],
      // xAxis: xAxis,
      // yAxis: yAxis,
      legend: {
        ...legend,
        show: true,
      },
      //已入series
      // label: label,
      tooltip: {
        ...tooltip,
      },
      grid: {
        ...grid,
        // top: 5,
        // bottom: 5,
        // let: 5,
        // right: 5
      },
      dataset: {
        dimensions: ["类目", "系列1", "系列2"],
        source: [
          {
            类目: "02",
            系列1: 110,
            系列2: 85,
          },
          {
            类目: "03",
            系列1: 120,
            系列2: 105,
          },
          {
            类目: "04",
            系列1: 115,
            系列2: 100,
          },
        ],
      },
      series: [
        {
          type: "pie",
          radius: "60%",
          minShowLabelAngle: 1,
          avoidLabelOverlap: false,
          emphasis: {
            itemStyle: {
              shadowBlur: 10,
              shadowOffsetX: 0,
              shadowColor: "#00000080",
            },
          },
          itemStyle: { borderRadius: 0, borderWidth: 0, borderColor: "#000" },
          label: {
            ...label,
            show: true,
            position: "outside",
            normal: {
              show: true,
              formatter: "{c}({d}%)",
              // formatter: function (e) {
              //   let data = e.data
              //   return data.name
              // }
            },
          },
          tooltip: {},
          // ...series
        },
      ],
    },
  },
  // 环形图
  ringPie: {
    header: {
      ...header,
      text: "环形图",
    },
    body,
    // base,
    options: {
      mergeData: {
        show: true,
        value: 1,
      },
      ...rest,
      color: [...getColorQueue()],
      // xAxis: xAxis,
      // yAxis: yAxis,
      legend: legend,
      //已入series
      // label: label,
      tooltip: {
        ...tooltip,
      },
      grid: grid,
      dataset: {
        dimensions: ["类目", "系列1"],
        source: [
          {
            类目: "02",
            系列1: 110,
          },
          {
            类目: "03",
            系列1: 120,
          },
          {
            类目: "04",
            系列1: 115,
          },
        ],
      },
      series: [
        {
          type: "pie",
          radius: ["30%", "50%"],
          minAngle: 5,
          avoidLabelOverlap: false,
          emphasis: {
            label: {
              show: true,
              fontSize: "14",
              fontWeight: "bold",
            },
            itemStyle: {
              shadowBlur: 10,
              shadowOffsetX: 0,
              shadowColor: "#FFFFFF80",
            },
          },
          itemStyle: { borderRadius: 0, borderWidth: 0, borderColor: "#000" },
          label: {
            ...label,
            position: "outside",
            show: true,
            normal: {
              show: true,
              formatter: "{b}({d}%)",
            },
          },
          tooltip: {},
          ...series,
        },
      ],
    },
  },
  // 散点图
  scatter: {
    header: {
      ...header,
      text: "散点图",
    },
    body,
    // base,
    options: {
      ...rest,
      color: [...getColorQueue()],
      xAxis: xAxis,
      yAxis: yAxis,
      legend: legend,
      //已入series
      // label: label,
      tooltip: tooltip,
      grid: grid,
      dataset: {
        dimensions: ["类目", "系列1"],
        source: [
          {
            类目: "02",
            系列1: 110,
          },
          {
            类目: "03",
            系列1: 120,
          },
          {
            类目: "04",
            系列1: 115,
          },
        ],
      },
      series: [
        {
          type: "scatter",
          itemStyle: { borderRadius: 0, borderWidth: 0, borderColor: "#000" },
          label: {
            ...label,
            position: "inside",
            show: false,
          },
          labelLine: {
            show: true,
            lineStyle: { color: "", width: 1 },
          },
          colorBy: "series",
          symbolSize: 20,
          datasetIndex: 0,
          markLine: markLine,
          tooltip: {},
          ...series,
        },
        {
          type: "scatter",
          // itemStyle: { borderRadius: 0, borderWidth: 0, borderColor: "#000" },
          // label: {
          //   ...label,
          //   position: "inside",
          //   show: false
          // },
          // labelLine: {
          //   show: true,
          //   lineStyle: { color: "", width: 1 },
          // },
          // colorBy: "series",
          symbolSize: 20,
          datasetIndex: 1,
          ...series,
          // markLine: markLine,
        },
      ],
    },
  },
  // 气泡散点图
  airScatter: {
    header: {
      ...header,
      text: "气泡图",
    },
    body,
    // base,
    options: {
      ...rest,
      color: [...getColorQueue()],
      xAxis: xAxis,
      yAxis: yAxis,
      legend: legend,
      //已入series
      // label: label,
      tooltip: tooltip,
      grid: grid,
      dataset: {
        dimensions: ["类目", "系列1"],
        source: [
          {
            类目: "02",
            系列1: 110,
          },
          {
            类目: "03",
            系列1: 120,
          },
          {
            类目: "04",
            系列1: 115,
          },
        ],
      },
      visualMap: [
        {
          // type: 'continuous',
          // dimension: 2,
          show: false,
          inRange: {
            symbolSize: [10, 40],
          },
        },
      ],
      series: [
        {
          type: "scatter",
          itemStyle: { borderRadius: 0, borderWidth: 0, borderColor: "#000" },
          label: {
            ...label,
            position: "inside",
            show: false,
          },
          labelLine: {
            show: false,
            lineStyle: { color: "", width: 1 },
          },
          colorBy: "series",
          datasetIndex: 0,
          markLine: markLine,
          tooltip: {},
          ...series,
        },
        {
          type: "scatter",
          // itemStyle: { borderRadius: 0, borderWidth: 0, borderColor: "#000" },
          // label: {
          //   ...label,
          //   position: "inside",
          //   show: false
          // },
          // labelLine: {
          //   show: true,
          //   lineStyle: { color: "", width: 1 },
          // },
          // colorBy: "series",
          datasetIndex: 1,
          // markLine: markLine,
          tooltip: {},
          ...series,
        },
      ],
    },
  },
  // 漏斗图
  funnel: {
    header: {
      ...header,
      text: "漏斗图",
    },
    body,
    // base,
    options: {
      ...rest,
      color: [...getColorQueue()],
      legend: legend,
      tooltip: {
        ...tooltip,
        // formatter: ' {c}'
      },
      grid,
      dataset: {
        dimensions: ["类目", "系列1"],
        source: [
          {
            类目: "02",
            系列1: 110,
          },
          {
            类目: "03",
            系列1: 120,
          },
          {
            类目: "04",
            系列1: 115,
          },
        ],
      },
      series: [
        {
          // name: '漏斗图',
          type: "funnel",
          left: "25%",
          top: 40,
          bottom: 40,
          width: "50%",
          minSize: "0%",
          maxSize: "100%",
          sort: "descending",
          gap: 2,
          funnelAlign: "center",
          label: {
            ...label,
            show: false,
          },
          itemStyle: {
            borderWidth: 0,
          },
          emphasis: {
            // disabled:true,
            label: {
              fontSize: 16,
              show: false,
            },
            labelLine: {
              show: false,
            },
          },
          tooltip: {},
          ...series,
        },
      ],
    },
  },
  // 桑葚图
  sankey: {
    header: {
      ...header,
      text: "桑基图",
    },
    body,
    // base,
    options: {
      ...rest,
      color: [...getColorQueue()],
      seriesColor: [...getColorQueue()].map((color) => ({
        node: {
          color,
          borderColor: color,
          borderWidth: 1,
        },
        link: {
          color,
          curveness: 0.5,
        },
      })),
      tooltip: {
        ...tooltip,
        formatter: "{c}({d}%)",
      },
      grid,
      dataset: {
        source: [
          [
            {
              name: "北京",
            },
            {
              name: "天津",
            },
            {
              name: "河北",
            },
            {
              name: "上海",
            },
            {
              name: "深圳",
            },
          ],
          [
            {
              source: "北京",
              target: "深圳",
              value: 5,
            },
            {
              source: "天津",
              target: "上海",
              value: 3,
            },
            {
              source: "天津",
              target: "深圳",
              value: 4,
            },
            {
              source: "河北",
              target: "上海",
              value: 3,
            },
          ],
        ],
      },
      series: [
        {
          type: "sankey",
          data: [],
          links: [],
          top: "10%",
          bottom: "10%",
          left: "20%",
          right: "20%",
          nodeWidth: 8,
          nodeGap: 8,
          layoutIterations: 0,
          orient: "horizontal",
          draggable: true,
          _color: "loopf",
          levels: [],
          emphasis: {
            focus: "adjacency",
            label: {
              show: true,
            },
          },
          label: {
            ...label,
            position: "left",
            align: "right",
            show: false,
          },
          lineStyle: {
            color: "source",
            curveness: 0.5,
            opacity: 0.5,
          },
          tooltip: {},
          ...series,
        },
      ],
    },
  },
  // 分组面积图
  groupArea: {
    header: {
      ...header,
      text: "面积图",
    },
    body,
    // base,
    options: {
      ...rest,
      color: [...getColorQueue()],
      xAxis: xAxis,
      yAxis: yAxis,
      legend: {
        ...legend,
        // left: '10',
      },
      tooltip: tooltip,
      grid: grid,
      dataset: {
        dimensions: ["类目", "系列1", "系列2"],
        source: [
          {
            类目: "02",
            系列1: 110,
            系列2: 85,
          },
          {
            类目: "03",
            系列1: 120,
            系列2: 105,
          },
          {
            类目: "04",
            系列1: 115,
            系列2: 100,
          },
          {
            类目: "05",
            系列1: 265,
            系列2: 230,
          },
          {
            类目: "06",
            系列1: 120,
            系列2: 195,
          },
          {
            类目: "07",
            系列1: 205,
            系列2: 285,
          },
        ],
      },
      series: [
        {
          type: "line",
          smooth: true,
          lineStyle: {
            color: getColor(0),
            width: 2,
            type: "solid",
          },
          areaStyle: { color: getColor(0), opacity: 0.3 },
          itemStyle: {
            // 拐点颜色
            color: getColor(0),
          },
          showSymbol: true,
          symbol: "circle",
          symbolSize: 8,
          markLine: markLine,
          label: {
            ...label,
            show: false,
          },
          colorBy: "series",
          tooltip: {},
          ...series,
        },
        {
          type: "line",
          smooth: true,
          lineStyle: {
            color: getColor(1),
            width: 2,
            type: "solid",
          },
          areaStyle: { color: getColor(1), opacity: 0.3 },
          itemStyle: {
            // 拐点颜色
            color: getColor(1),
          },
          showSymbol: true,
          symbol: "circle",
          symbolSize: 8,
          markLine: markLine,
          label: {
            ...label,
            show: false,
          },
          colorBy: "series",
          tooltip: {},
          ...series,
        },
      ],
    },
  },
  // 网页iframe
  web: {
    // base,
    body,
    options: {
      url: "https://",
    },
  },
  // 静态词云
  wordCloud: {
    header: {
      ...header,
      text: "词云图",
    },
    body,
    // base,
    options: {
      ...rest,
      color: [...getColorQueue()],
      tooltip,
      grid,
      dataset: {
        source: [
          {
            name: "DORAVIS",
            value: 100,
            type: 1,
          },
          {
            name: "可视化大屏",
            value: 80,
            type: 2,
          },
          {
            name: "DORAVIS",
            value: 60,
            type: 2,
          },
          {
            name: "DORAVIS",
            value: 20,
            type: 2,
          },
          {
            name: "图表拖拉拽",
            value: 40,
            type: 3,
          },
          {
            name: "图表主题",
            value: 50,
            type: 3,
          },
          {
            name: "可视化大屏",
            value: 60,
            type: 3,
          },
          {
            name: "炫酷大屏",
            value: 60,
            type: 1,
          },
        ],
      },
      seriesColor: [...getColorQueue()],
      series: [
        {
          type: "wordCloud",
          shape: "Square",
          keepAspect: false,
          // maskImage: maskImage,
          left: "center",
          top: "center",
          width: "100%",
          height: "100%",
          right: null,
          bottom: null,
          sizeRange: [12, 40],
          rotationRange: [-90, 90],
          rotationStep: 45,
          gridSize: 4,
          drawOutOfBound: false,
          layoutAnimation: true,
          textStyle: {
            fontFamily: DEFAULT_FONT,
            color: "#4782f4",
          },
          data: [],
          tooltip: {},
          ...series,
        },
      ],
    },
  },
  area: {
    header: {
      text: "面积图",
      ...header,
    },
    body,
    // base,
    options: {
      color: [...getColorQueue()],
      xAxis: xAxis,
      yAxis: yAxis,
      legend: legend,
      tooltip: tooltip,
      grid: grid,
      dataset: {
        dimensions: ["类目", "系列1", "系列2"],
        source: [
          {
            类目: "02",
            系列1: 110,
            系列2: 85,
          },
          {
            类目: "03",
            系列1: 120,
            系列2: 105,
          },
          {
            类目: "04",
            系列1: 115,
            系列2: 100,
          },
        ],
      },
      series: [
        {
          type: "line",
          smooth: true,
          label: {
            ...label,
            show: false,
          },
          lineStyle: {
            color: getColor(0),
            width: 2,
            type: "solid",
          },
          areaStyle: { color: getColor(0) },
          itemStyle: {
            // 拐点颜色
            color: getColor(0),
          },
          showSymbol: true,
          symbol: "circle",
          symbolSize: 8,
          markLine: markLine,
          tooltip: {},
          ...series,
        },
      ],
    },
  },
  // 单组雷达图
  lineRadar: {
    header: {
      text: "雷达图",
      ...header,
    },
    body,
    // base,
    options: {
      ...rest,
      // color: [...colors],
      legend: {
        ...legend,
        // left: '10',
      },
      tooltip: {
        ...tooltip,
        show: false,
      },
      grid: grid,
      radar: {
        shape: "polygon",
        radius: "75%",
        splitLine: {
          show: true,
          lineStyle: {
            color: "#303543",
            width: 1,
            type: "solid",
          },
        },
        axisName: {
          show: true,
          color: "#595959",
          fontWeight: "normal",
          fontFamily: DEFAULT_FONT,
          fontSize: 12,
        },
        splitNumber: 5,
        splitArea: {
          areaStyle: {
            opacity: 0,
          },
        },
        indicator: [
          {
            name: "指标一",
            max: 6500,
          },
          {
            name: "指标二",
            max: 16000,
          },
          {
            name: "指标三",
            max: 30000,
          },
          {
            name: "指标四",
            max: 38000,
          },
          {
            name: "指标五",
            max: 52000,
          },
          {
            name: "指标六",
            max: 25000,
          },
        ],
      },
      series: [
        {
          type: "radar",
          lineStyle: {
            color: getColor(0),
            width: 2,
            type: "solid",
          },
          areaStyle: {
            color: "#3F5FA0",
            opacity: 0.7,
          },
          data: [
            {
              value: [4300, 10000, 28000, 35000, 50000, 19000],
              name: "系列1",
            },
            // {
            //   value: [5000, 14000, 28000, 31000, 42000, 21000],
            //   name: '名称2',
            // },
          ],

          itemStyle: {
            // 拐点颜色
            color: getColor(0),
          },
          showSymbol: true,
          symbol: "circle",
          symbolSize: 8,
          label: {
            ...label,
            show: false,
          },
          colorBy: "data",
          tooltip: {},
          ...series,
        },
      ],
    },
  },
  //折线柱状图
  lineBar: {
    header: {
      text: "折线柱状图",
      ...header,
    },
    body,
    // base,
    options: {
      ...rest,
      color: [...getColorQueue()],
      xAxis: xAxis,
      yAxis: [
        {
          ...yAxis,
          position: "left",
          splitLine: {
            show: false,
          },
        },
        {
          ...yAxis,
          position: "right",
          splitLine: {
            show: false,
          },
          axisLabel: {
            show: true,
            color: "#b2b2b2",
            fontSize: 12,
            fontFamily: DEFAULT_FONT,
            fontWeight: "normal",
            fontStyle: "normal",
            overflow: "truncate",
            ellipsis: "...",
            width: 60,
            align: "left",
            rotate: "0",
          },
        },
      ],
      legend: legend,
      //已入series
      // label: label,
      tooltip: tooltip,
      grid: grid,
      dataset: [
        {
          dimensions: ["类目", "系列1", "系列2"],
          source: [
            {
              类目: "02",
              系列1: 110,
              系列2: 85,
            },
            {
              类目: "03",
              系列1: 120,
              系列2: 105,
            },
            {
              类目: "04",
              系列1: 115,
              系列2: 100,
            },
          ],
        },
        {
          dimensions: ["类目", "系列1", "系列2"],
          source: [
            {
              类目: "02",
              系列1: 110,
              系列2: 85,
            },
            {
              类目: "03",
              系列1: 120,
              系列2: 105,
            },
            {
              类目: "04",
              系列1: 115,
              系列2: 100,
            },
          ],
        },
      ],
      series: [
        {
          type: "bar",
          itemStyle: {
            color: getColor(0),
            borderRadius: 0,
            borderWidth: 0,
            borderColor: getColor(0),
          },
          barWidth: 8,
          label: {
            ...label,
            show: false,
          },
          markLine: { ...markLine, symbol: "none" },
          yAxisIndex: 0,
          datasetIndex: 0,
          tooltip: {},
          ...series,
        },
        {
          type: "line",
          smooth: true,
          label: {
            ...label,
            show: false,
          },
          lineStyle: {
            color: getColor(0),
            width: 2,
            type: "solid",
          },
          itemStyle: {
            // 拐点颜色
            color: getColor(0),
          },
          showSymbol: true,
          symbol: "circle",
          symbolSize: 8,
          markLine: { ...markLine, symbol: "none" },
          yAxisIndex: 1,
          datasetIndex: 1,
          tooltip: {},
          ...series,
        },
      ],
    },
  },
  //基础关系图
  diagram: {
    header: {
      text: "基础关系图",
      ...header,
    },
    body,
    // base,
    options: {
      ...rest,
      color: [...getColorQueue()],
      // legend: {
      //   ...legend,
      //   left: '10',
      // },
      //已入series
      // label: label,
      tooltip: {
        ...tooltip,
        axisPointer: {
          type: "shadow",
        },
      },
      series: [
        {
          type: "graph",
          layout: "force",
          roam: false,
          force: {
            repulsion: 250,
            gravity: 0.1,
            edgeLength: 10,
          },
          tooltip: {},
          nodes: [
            {
              name: "echarts",
              symbolSize: 60,
              category: "级别1",
            },
            {
              name: "tooltip",
              symbolSize: 30,
              category: "级别2",
            },
            {
              name: "series",
              symbolSize: 30,
              category: "级别2",
            },
            {
              name: "textStyle",
              symbolSize: 20,
              category: "级别3",
            },
            {
              name: "position",
              symbolSize: 20,
              category: "级别3",
            },
            {
              name: "bar",
              symbolSize: 20,
              category: "级别3",
            },
            {
              name: "line",
              symbolSize: 20,
              category: "级别3",
            },
          ],
          links: [
            {
              source: "echarts",
              target: "tooltip",
            },
            {
              source: "echarts",
              target: "series",
            },
            {
              source: "tooltip",
              target: "textStyle",
            },
            {
              source: "tooltip",
              target: "position",
            },
            {
              source: "series",
              target: "bar",
            },
            {
              source: "series",
              target: "line",
            },
          ],
          categories: [{ name: "级别1" }, { name: "级别2" }, { name: "级别3" }],
          label: label,
          lineStyle: {
            color: "source",
            curveness: 0.3,
            width: 1,
            type: "solid",
            opacity: 1,
          },
          itemStyle: {
            // 拐点颜色
            // color: colors[0],
          },
          emphasis: {
            focus: "adjacency",
            lineStyle: {
              width: 10,
            },
          },
          ...series,
        },
      ],
    },
  },
  //轮播表格
  shufflTable: {
    header: {
      ...header,
      text: "明细表",
    },
    body,
    // base: {
    //   ...base,
    //   w: colNum,
    //   h: base.h * 1.5,
    // },
    options: {
      style: { ...shufflTableStyle },
      dataset: {
        source: [
          ["2015", "2016", "2017", "2018", "2019"],
          [60, 75, 85, 91, "105"],
          [65, 73, 83, 94, 106],
          [64, 71, 89, 95, 107],
          [64, 71, 89, 95, 107],
          [64, 71, 89, 95, 107],
          [64, 71, 89, 95, 107],
          [641, 71, 893, 95, 107],
          [643, 71, 89, 95, 107],
          [645, 71, 89, 95, 107],
          [648, 71, 89, 95, 107],
          [6400, 71, 89, 95, 107],
          [6499, 71, 89, 95, 10788],
          [644444, 71, 89, 95, 107],
        ],
      },
    },
  },
  crosstab: {
    header: {
      ...header,
      text: "交叉表",
    },
    body,
    // base: {
    //   ...base,
    //   w: colNum,
    //   h: base.h * 1.5,
    // },
    options: {
      style: { ...crosstabStyle },
      dataset: {
        source: [],
      },
    },
  },
  metricCard: {
    header: {
      ...header,
      show: false,
      text: "指标卡",
    },
    body,
    // base: {
    //   ...base,
    //   w: colNum,
    //   h: base.h * 1.5,
    // },
    options: {
      style: { ...metricCardStyle },
    },
  },
  textContent: {
    ...textContent,
    // base: {
    //   ...base,
    //   w: 3,
    //   h: 3,
    // },
    body,
  },
  // //日期组件
  // dateContent: {
  //   header: {
  //     text: '日期',
  //     ...header,
  //   },
  //   base: {
  //     w: 3,
  //     h: 1,
  //     ...base
  //   },
  //   options: {
  //     style: { ...dateContentStyle },
  //     dataset: null,
  //   },
  // },
  //时间组件
  // clockContent: {
  //   header: {
  //     text: '时钟',
  //     ...header,
  //   },
  //   base: {
  //     w: 3,
  //     h: 1,
  //     ...base
  //   },
  //   options: {
  //     style: { ...clockContentStyle },
  //     dataset: null,
  //   },
  // },
  // 图片组件
  imageContent: {
    ...imageContent,
    header: {
      text: "图片",
      ...header,
    },
    body,
  },
  // 水波图
  waveInstrument: {
    ...waveInstrument,
    header: {
      text: "水波图",
      ...header,
    },
    body,
  },
  //仪表盘
  pointerInstrument: {
    header: {
      text: "仪表盘",
      ...header,
    },
    // base,
    body,
    options: {
      ...rest,
      color: [...getColorQueue()],
      grid: {
        left: 10,
        right: 10,
        bottom: 5,
        top: 5,
      },
      tooltip: {
        ...tooltip,
        axisPointer: {
          type: "shadow",
        },
      },

      series: [
        {
          type: "gauge",
          progress: {
            show: true,
            roundCap: false,
            clip: true,
            width: 10,
            itemStyle: {
              color: getColor(0),
            },
          },

          axisLine: {
            show: true,
            lineStyle: {
              width: 10,
              color: [
                [1, "#ffffff"],
                // ['', '#37a2da'],
                // ['', '#fd666d']
              ],
            },
          },
          axisTick: {
            splitNumber: 5,
            show: true,
            length: 6,
            distance: 0,
            lineStyle: {
              color: "#FFFFFF80",
              width: 1,
              type: "solid",
            },
          },

          axisLabel: {
            distance: 15,
            show: true,
            color: "#b2b2b2",
            fontSize: 12,
            fontFamily: DEFAULT_FONT,
            fontWeight: "normal",
            formatter: (value) => {
              return value.toFixed(2);
            },
          },
          splitLine: {
            show: true,
            length: 10,
            distance: -10,
            lineStyle: {
              color: DEFAULT_COLOR,
              width: 1,
              type: "solid",
            },
          },
          pointer: {
            show: true,
            offsetCenter: [0, 0],
            length: "60%",
            width: 6,
            itemStyle: {
              color: "#1BCF9A",
            },
          },
          title: {
            show: true,
            // offsetCenter: [0, '65%'],
            color: "#b2b2b2",
            fontSize: 12,
            fontFamily: DEFAULT_FONT,
            fontWeight: "normal",
          },
          detail: {
            valueAnimation: true,
            show: true,
            offsetCenter: [0, "40%"],
            fontSize: 32,
            fontFamily: DEFAULT_FONT,
            fontWeight: "normal",
          },
          min: 0,
          max: 100,
          startAngle: 210,
          endAngle: -30,
          splitNumber: 10,
          radius: "75%",
          tooltip: {},
        },
      ],
    },
  },
  //进度条
  progressContent: {
    ...progressContent,
    header: {
      ...header,
      backgroundColor: "",
      text: "进度条",
    },
    body,
  },
  selectFilterContent: {
    ...selectFilterContent,
    header: {
      ...header,
      backgroundColor: "",
      text: "列表",
    },
    body,
  },
  dateFilterContent: {
    ...dateFilterContent,
    header: {
      ...header,
      backgroundColor: "",
      text: "日期",
    },
    body,
  },
  numberFilterContent: {
    ...numberFilterContent,
    header: {
      ...header,
      backgroundColor: "",
      text: "范围筛选器",
    },
    body,
  },
};
